@blotoutio/edgetag-sdk-browser 1.36.1 → 1.36.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 +14 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -132,6 +132,18 @@
132
132
  ...expand('911,921,922,923,924,926,927,932,933,935,942,944,946,950,953,955,957-958,960-969,974,975,976,977,981-982,987,988,990-999'),
133
133
  ]);
134
134
 
135
+ function tryParse(json, fallbackValue) {
136
+ try {
137
+ if (json) {
138
+ return JSON.parse(json);
139
+ }
140
+ }
141
+ catch {
142
+ /* do nothing */
143
+ }
144
+ return fallbackValue;
145
+ }
146
+
135
147
  const isZeroPurchaseEvent = (payload) => {
136
148
  var _a;
137
149
  if (payload.eventName != 'Purchase') {
@@ -814,7 +826,7 @@
814
826
  * this function when cloning user-provided objects since structuredClone
815
827
  * will throw an error if given an object with functions.
816
828
  */
817
- const jsonClone = (json) => JSON.parse(JSON.stringify(json));
829
+ const jsonClone = (json) => tryParse(JSON.stringify(json), undefined);
818
830
 
819
831
  // eslint-disable-next-line @nx/enforce-module-boundaries
820
832
  const getGlobalSettings = () => {
@@ -1272,7 +1284,7 @@
1272
1284
  referrer: getReferrer(destination),
1273
1285
  search: getSearch(destination),
1274
1286
  locale: getLocale(),
1275
- sdkVersion: "1.36.1" ,
1287
+ sdkVersion: "1.36.2" ,
1276
1288
  ...(payload || {}),
1277
1289
  };
1278
1290
  let storage = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blotoutio/edgetag-sdk-browser",
3
- "version": "1.36.1",
3
+ "version": "1.36.2",
4
4
  "description": "Browser SDK for EdgeTag",
5
5
  "author": "Blotout",
6
6
  "license": "MIT",