@microsoft/applicationinsights-properties-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 properties plugin, 3.0.0-beta.2301-18
2
+ * Microsoft Application Insights properties 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 - Properties Plugin, 3.0.0-beta.2301-18
2
+ * Application Insights JavaScript SDK - Properties Plugin, 3.0.0-beta.2301-19
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -1196,7 +1196,7 @@
1196
1196
  }
1197
1197
 
1198
1198
  var _objDefineProperty = ObjDefineProperty;
1199
- var version = "3.0.0-beta.2301-18";
1199
+ var version = "3.0.0-beta.2301-19";
1200
1200
  var instanceName = "." + newId(6);
1201
1201
  var _dataUid = 0;
1202
1202
  function _createAccessor(target, prop, value) {
@@ -1416,9 +1416,11 @@
1416
1416
  }
1417
1417
  };
1418
1418
  var checkDynamic = true;
1419
+ var isObjectOrArray = false;
1419
1420
  function _getProperty() {
1420
1421
  if (checkDynamic) {
1421
- if (value && !value[CFG_HANDLER_LINK] && (isPlainObject(value) || isArray(value))) {
1422
+ isObjectOrArray = isObjectOrArray || (value && (isPlainObject(value) || isArray(value)));
1423
+ if (value && !value[CFG_HANDLER_LINK] && isObjectOrArray) {
1422
1424
  value = _makeDynamicObject(state, value);
1423
1425
  }
1424
1426
  checkDynamic = false;
@@ -1439,11 +1441,15 @@
1439
1441
  if (!!_getProperty[state.ro] && !state.upd) {
1440
1442
  throwInvalidAccess("[" + name + "] is read-only:" + dumpObj(theConfig));
1441
1443
  }
1442
- var isReferenced = _getProperty[state.rf];
1443
- if (isPlainObject(value) || isArray(value)) {
1444
+ if (checkDynamic) {
1445
+ isObjectOrArray = isObjectOrArray || (value && (isPlainObject(value) || isArray(value)));
1446
+ checkDynamic = false;
1447
+ }
1448
+ var isReferenced = isObjectOrArray && _getProperty[state.rf];
1449
+ if (isObjectOrArray) {
1444
1450
  if (isReferenced) {
1445
1451
  objForEachKey(value, function (key) {
1446
- value[key] = newValue[key];
1452
+ value[key] = newValue ? newValue[key] : UNDEFINED_VALUE;
1447
1453
  });
1448
1454
  objForEachKey(newValue, function (key, theValue) {
1449
1455
  _setDynamicProperty(state, value, key, theValue);
@@ -1460,11 +1466,14 @@
1460
1466
  });
1461
1467
  }
1462
1468
  }
1463
- checkDynamic = false;
1464
- if (!isReferenced && (isPlainObject(newValue) || isArray(newValue))) {
1465
- _makeDynamicObject(state, newValue);
1469
+ if (newValue !== value) {
1470
+ var newIsObjectOrArray = newValue && (isPlainObject(newValue) || isArray(newValue));
1471
+ if (!isReferenced && newIsObjectOrArray) {
1472
+ _makeDynamicObject(state, newValue);
1473
+ }
1474
+ value = newValue;
1475
+ isObjectOrArray = newIsObjectOrArray;
1466
1476
  }
1467
- value = newValue;
1468
1477
  state.add(detail);
1469
1478
  }
1470
1479
  }
@@ -1493,9 +1502,9 @@
1493
1502
  }
1494
1503
  return value;
1495
1504
  }
1496
- function _makeDynamicObject(state, target ) {
1505
+ function _makeDynamicObject(state, target) {
1497
1506
  var _a;
1498
- objForEachKey( target, function (key, value) {
1507
+ objForEachKey(target, function (key, value) {
1499
1508
  _setDynamicProperty(state, target, key, value);
1500
1509
  });
1501
1510
  if (!target[CFG_HANDLER_LINK]) {