@microsoft/applicationinsights-dependencies-js 3.0.0-beta.2301-18 → 3.0.0-beta.2301-19

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft Application Insights XHR dependencies plugin, 3.0.0-beta.2301-18
2
+ * Microsoft Application Insights XHR dependencies plugin, 3.0.0-beta.2301-19
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  *
5
5
  * Microsoft Application Insights Team
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Dependencies Plugin, 3.0.0-beta.2301-18
2
+ * Application Insights JavaScript SDK - Dependencies Plugin, 3.0.0-beta.2301-19
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -974,6 +974,7 @@
974
974
  throw new aggregationErrorType(message, sourceErrors || []);
975
975
  }
976
976
 
977
+ var UNDEFINED_VALUE = undefined;
977
978
  var STR_EMPTY = "";
978
979
  var STR_CORE = "core";
979
980
  var STR_DISABLED = "disabled";
@@ -1217,7 +1218,7 @@
1217
1218
  }
1218
1219
 
1219
1220
  var _objDefineProperty = ObjDefineProperty;
1220
- var version = "3.0.0-beta.2301-18";
1221
+ var version = "3.0.0-beta.2301-19";
1221
1222
  var instanceName = "." + newId(6);
1222
1223
  var _dataUid = 0;
1223
1224
  function _createAccessor(target, prop, value) {
@@ -1437,9 +1438,11 @@
1437
1438
  }
1438
1439
  };
1439
1440
  var checkDynamic = true;
1441
+ var isObjectOrArray = false;
1440
1442
  function _getProperty() {
1441
1443
  if (checkDynamic) {
1442
- if (value && !value[CFG_HANDLER_LINK] && (isPlainObject(value) || isArray(value))) {
1444
+ isObjectOrArray = isObjectOrArray || (value && (isPlainObject(value) || isArray(value)));
1445
+ if (value && !value[CFG_HANDLER_LINK] && isObjectOrArray) {
1443
1446
  value = _makeDynamicObject(state, value);
1444
1447
  }
1445
1448
  checkDynamic = false;
@@ -1460,11 +1463,15 @@
1460
1463
  if (!!_getProperty[state.ro] && !state.upd) {
1461
1464
  throwInvalidAccess("[" + name + "] is read-only:" + dumpObj(theConfig));
1462
1465
  }
1463
- var isReferenced = _getProperty[state.rf];
1464
- if (isPlainObject(value) || isArray(value)) {
1466
+ if (checkDynamic) {
1467
+ isObjectOrArray = isObjectOrArray || (value && (isPlainObject(value) || isArray(value)));
1468
+ checkDynamic = false;
1469
+ }
1470
+ var isReferenced = isObjectOrArray && _getProperty[state.rf];
1471
+ if (isObjectOrArray) {
1465
1472
  if (isReferenced) {
1466
1473
  objForEachKey(value, function (key) {
1467
- value[key] = newValue[key];
1474
+ value[key] = newValue ? newValue[key] : UNDEFINED_VALUE;
1468
1475
  });
1469
1476
  objForEachKey(newValue, function (key, theValue) {
1470
1477
  _setDynamicProperty(state, value, key, theValue);
@@ -1481,11 +1488,14 @@
1481
1488
  });
1482
1489
  }
1483
1490
  }
1484
- checkDynamic = false;
1485
- if (!isReferenced && (isPlainObject(newValue) || isArray(newValue))) {
1486
- _makeDynamicObject(state, newValue);
1491
+ if (newValue !== value) {
1492
+ var newIsObjectOrArray = newValue && (isPlainObject(newValue) || isArray(newValue));
1493
+ if (!isReferenced && newIsObjectOrArray) {
1494
+ _makeDynamicObject(state, newValue);
1495
+ }
1496
+ value = newValue;
1497
+ isObjectOrArray = newIsObjectOrArray;
1487
1498
  }
1488
- value = newValue;
1489
1499
  state.add(detail);
1490
1500
  }
1491
1501
  }
@@ -1514,9 +1524,9 @@
1514
1524
  }
1515
1525
  return value;
1516
1526
  }
1517
- function _makeDynamicObject(state, target ) {
1527
+ function _makeDynamicObject(state, target) {
1518
1528
  var _a;
1519
- objForEachKey( target, function (key, value) {
1529
+ objForEachKey(target, function (key, value) {
1520
1530
  _setDynamicProperty(state, target, key, value);
1521
1531
  });
1522
1532
  if (!target[CFG_HANDLER_LINK]) {