@builder.io/sdk 2.2.8 → 2.2.9

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.
package/dist/index.esm.js CHANGED
@@ -118,7 +118,7 @@ function assertAllowedPropertyName(name) {
118
118
  throw new Error("Property name \"".concat(name, "\" is not allowed"));
119
119
  }
120
120
 
121
- var version = "2.2.8";
121
+ var version = "2.2.9";
122
122
 
123
123
  var Subscription = /** @class */ (function () {
124
124
  function Subscription(listeners, listener) {
@@ -1748,15 +1748,20 @@ var Builder = /** @class */ (function () {
1748
1748
  };
1749
1749
  Builder.prototype.setTestsFromUrl = function () {
1750
1750
  var search = this.getLocation().search;
1751
- var params = QueryString.parseDeep(this.modifySearch(search || '').substr(1));
1752
- var tests = params.builder && params.builder.tests;
1753
- if (tests && typeof tests === 'object') {
1754
- for (var key in tests) {
1755
- if (tests.hasOwnProperty(key)) {
1756
- this.setTestCookie(key, tests[key]);
1751
+ try {
1752
+ var params = QueryString.parseDeep(this.modifySearch(search || '').substr(1));
1753
+ var tests = params.builder && params.builder.tests;
1754
+ if (tests && typeof tests === 'object') {
1755
+ for (var key in tests) {
1756
+ if (tests.hasOwnProperty(key)) {
1757
+ this.setTestCookie(key, tests[key]);
1758
+ }
1757
1759
  }
1758
1760
  }
1759
1761
  }
1762
+ catch (e) {
1763
+ console.debug('Error parsing tests from URL', e);
1764
+ }
1760
1765
  };
1761
1766
  Builder.prototype.resetOverrides = function () {
1762
1767
  // Ugly - pass down instances per request instead using react context
@@ -1774,41 +1779,46 @@ var Builder = /** @class */ (function () {
1774
1779
  };
1775
1780
  Builder.prototype.getOverridesFromQueryString = function () {
1776
1781
  var location = this.getLocation();
1777
- var params = QueryString.parseDeep(this.modifySearch(location.search || '').substr(1));
1778
- var builder = params.builder;
1779
- if (builder) {
1780
- var userAttributes = builder.userAttributes, overrides = builder.overrides, env = builder.env; builder.host; var api = builder.api, cachebust = builder.cachebust, noCache = builder.noCache, preview = builder.preview, editing = builder.editing, frameEditing = builder.frameEditing, options = builder.options, overrideParams = builder.params;
1781
- if (userAttributes) {
1782
- this.setUserAttributes(userAttributes);
1783
- }
1784
- if (options) {
1785
- // picking only locale, includeRefs, and enrich for now
1786
- this.queryOptions = __assign(__assign(__assign({}, (options.locale && { locale: options.locale })), (options.includeRefs && { includeRefs: options.includeRefs })), (options.enrich && { enrich: options.enrich }));
1787
- }
1788
- if (overrides) {
1789
- this.overrides = overrides;
1790
- }
1791
- if (validEnvList.indexOf(env || api) > -1) {
1792
- this.env = env || api;
1793
- }
1794
- if (Builder.isEditing) {
1795
- var editingModel = frameEditing || editing || preview;
1796
- if (editingModel && editingModel !== 'true') {
1797
- this.editingModel = editingModel;
1782
+ try {
1783
+ var params = QueryString.parseDeep(this.modifySearch(location.search || '').substr(1));
1784
+ var builder = params.builder;
1785
+ if (builder) {
1786
+ var userAttributes = builder.userAttributes, overrides = builder.overrides, env = builder.env, host = builder.host, api = builder.api, cachebust = builder.cachebust, noCache = builder.noCache, preview = builder.preview, editing = builder.editing, frameEditing = builder.frameEditing, options = builder.options, overrideParams = builder.params;
1787
+ if (userAttributes) {
1788
+ this.setUserAttributes(userAttributes);
1789
+ }
1790
+ if (options) {
1791
+ // picking only locale, includeRefs, and enrich for now
1792
+ this.queryOptions = __assign(__assign(__assign({}, (options.locale && { locale: options.locale })), (options.includeRefs && { includeRefs: options.includeRefs })), (options.enrich && { enrich: options.enrich }));
1793
+ }
1794
+ if (overrides) {
1795
+ this.overrides = overrides;
1796
+ }
1797
+ if (validEnvList.indexOf(env || api) > -1) {
1798
+ this.env = env || api;
1799
+ }
1800
+ if (Builder.isEditing) {
1801
+ var editingModel = frameEditing || editing || preview;
1802
+ if (editingModel && editingModel !== 'true') {
1803
+ this.editingModel = editingModel;
1804
+ }
1805
+ }
1806
+ if (cachebust) {
1807
+ this.cachebust = true;
1808
+ }
1809
+ if (noCache) {
1810
+ this.noCache = true;
1811
+ }
1812
+ if (preview) {
1813
+ this.preview = true;
1814
+ }
1815
+ if (params) {
1816
+ this.overrideParams = overrideParams;
1798
1817
  }
1799
1818
  }
1800
- if (cachebust) {
1801
- this.cachebust = true;
1802
- }
1803
- if (noCache) {
1804
- this.noCache = true;
1805
- }
1806
- if (preview) {
1807
- this.preview = true;
1808
- }
1809
- if (params) {
1810
- this.overrideParams = overrideParams;
1811
- }
1819
+ }
1820
+ catch (e) {
1821
+ console.debug('Error parsing overrides from URL', e);
1812
1822
  }
1813
1823
  };
1814
1824
  Builder.prototype.messageFrameLoaded = function () {