@microsoft/applicationinsights-web-basic 3.0.0-beta.2302-06 → 3.0.0-beta.2303-02

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.ApplicationInsights, 3.0.0-beta.2302-06
2
+ * Microsoft.ApplicationInsights, 3.0.0-beta.2303-02
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 Web SDK - Basic, 3.0.0-beta.2302-06
2
+ * Application Insights JavaScript Web SDK - Basic, 3.0.0-beta.2303-02
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -9,7 +9,7 @@
9
9
  })(this, (function (exports) { 'use strict';
10
10
 
11
11
  /*!
12
- * Microsoft Dynamic Proto Utility, 1.1.7
12
+ * Microsoft Dynamic Proto Utility, 1.1.8
13
13
  * Copyright (c) Microsoft and contributors. All rights reserved.
14
14
  */
15
15
  var _a$5;
@@ -376,7 +376,7 @@
376
376
  }
377
377
 
378
378
  /*!
379
- * NevWare21 - ts-utils, 0.8.0
379
+ * NevWare21 - ts-utils, 0.8.1
380
380
  * https://github.com/nevware21/ts-utils
381
381
  * Copyright (c) NevWare21 and contributors. All rights reserved.
382
382
  * Licensed under the MIT license.
@@ -398,6 +398,7 @@
398
398
  var LENGTH = "length";
399
399
  var DONE = "done";
400
400
  var VALUE = "value";
401
+ var NAME = "name";
401
402
  var ObjClass = Object;
402
403
  var ObjProto = ObjClass[PROTOTYPE];
403
404
  var StrCls = String;
@@ -812,22 +813,37 @@
812
813
  };
813
814
  return fn(obj, proto);
814
815
  }
815
- function _createCustomError(name, d, b) {
816
- objSetPrototypeOf(d, b);
816
+ function _createCustomError(name, d, baseClass) {
817
+ objSetPrototypeOf(d, baseClass);
817
818
  function __() {
818
819
  this.constructor = d;
820
+ this[NAME] = name;
819
821
  }
820
- __[PROTOTYPE] = b[PROTOTYPE];
821
- __[PROTOTYPE].name = name;
822
+ __[PROTOTYPE] = baseClass[PROTOTYPE];
822
823
  d[PROTOTYPE] = new __();
823
824
  return d;
824
825
  }
826
+ var _safeSetName = function (baseClass, name) {
827
+ try {
828
+ baseClass[PROTOTYPE][NAME] = name;
829
+ }
830
+ catch (e) {
831
+ }
832
+ };
825
833
  function createCustomError(name, constructCb) {
826
834
  var baseClass = Error;
835
+ var orgName = baseClass[PROTOTYPE][NAME];
827
836
  var customError = _createCustomError(name, function () {
828
837
  var _this = this;
829
- _this = baseClass.apply(_this, arguments) || _this;
830
- constructCb && constructCb(_this, arguments);
838
+ try {
839
+ _safeSetName(baseClass, name);
840
+ _this = baseClass.apply(_this, arguments) || _this;
841
+ _this[NAME] = name;
842
+ constructCb && constructCb(_this, arguments);
843
+ }
844
+ finally {
845
+ _safeSetName(baseClass, orgName);
846
+ }
831
847
  return _this;
832
848
  }, baseClass);
833
849
  return customError;
@@ -1035,49 +1051,77 @@
1035
1051
  var polyStrTrim = _createTrimFn(/^\s+|(?=\s)\s+$/g);
1036
1052
  var TRIM = "trim";
1037
1053
  var strTrim = _unwrapFunction(TRIM, UNDEF_VALUE, polyStrTrim);
1054
+ var REF = "ref";
1055
+ var UNREF = "un" + REF;
1056
+ var HAS_REF = "hasRef";
1057
+ var ENABLED = "enabled";
1038
1058
  function _createTimerHandler(startTimer, refreshFn, cancelFn) {
1059
+ var _a;
1039
1060
  var ref = true;
1040
1061
  var timerId = startTimer ? refreshFn(null) : null;
1041
- function _unref() {
1062
+ var theTimerHandler;
1063
+ var _unref = function () {
1042
1064
  ref = false;
1043
- timerId && timerId["unref"] && timerId["unref"]();
1044
- return timer;
1045
- }
1046
- function _ref() {
1065
+ timerId && timerId[UNREF] && timerId[UNREF]();
1066
+ return theTimerHandler;
1067
+ };
1068
+ var _ref = function () {
1047
1069
  ref = true;
1048
- timerId && timerId["ref"] && timerId["ref"]();
1049
- return timer;
1050
- }
1051
- function _hasRef() {
1052
- if (timerId && timerId["hasRef"]) {
1053
- return timerId["hasRef"]();
1070
+ timerId && timerId[REF] && timerId[REF]();
1071
+ return theTimerHandler;
1072
+ };
1073
+ var _hasRef = function () {
1074
+ if (timerId && timerId[HAS_REF]) {
1075
+ return timerId[HAS_REF]();
1054
1076
  }
1055
1077
  return ref;
1056
- }
1057
- var timer = {
1058
- cancel: function () {
1059
- timerId && cancelFn(timerId);
1060
- timerId = null;
1061
- },
1062
- refresh: function () {
1063
- timerId = refreshFn(timerId);
1064
- if (!ref) {
1065
- _unref();
1066
- }
1067
- return timer;
1078
+ };
1079
+ var _refresh = function () {
1080
+ timerId = refreshFn(timerId);
1081
+ if (!ref) {
1082
+ _unref();
1083
+ }
1084
+ return theTimerHandler;
1085
+ };
1086
+ var _cancel = function () {
1087
+ timerId && cancelFn(timerId);
1088
+ timerId = null;
1089
+ };
1090
+ var _setEnabled = function (value) {
1091
+ !value && timerId && _cancel();
1092
+ value && !timerId && _refresh();
1093
+ };
1094
+ theTimerHandler = (_a = {
1095
+ cancel: _cancel,
1096
+ refresh: _refresh
1068
1097
  },
1069
- hasRef: _hasRef,
1070
- ref: _ref,
1071
- unref: _unref
1098
+ _a[HAS_REF] = _hasRef,
1099
+ _a[REF] = _ref,
1100
+ _a[UNREF] = _unref,
1101
+ _a[ENABLED] = false,
1102
+ _a);
1103
+ objDefineProp(theTimerHandler, ENABLED, {
1104
+ get: function () { return !!timerId; },
1105
+ set: _setEnabled
1106
+ });
1107
+ return {
1108
+ h: theTimerHandler,
1109
+ dn: function () {
1110
+ timerId = null;
1111
+ }
1072
1112
  };
1073
- return timer;
1074
1113
  }
1075
1114
  function _createTimeoutWith(self, startTimer, overrideFn, theArgs) {
1076
1115
  var isArr = isArray(overrideFn);
1077
1116
  var len = isArr ? overrideFn.length : 0;
1078
1117
  var setFn = (len > 0 ? overrideFn[0] : (!isArr ? overrideFn : UNDEF_VALUE)) || setTimeout;
1079
1118
  var clearFn = (len > 1 ? overrideFn[1] : UNDEF_VALUE) || clearTimeout;
1080
- return _createTimerHandler(startTimer, function (timerId) {
1119
+ var timerFn = theArgs[0];
1120
+ theArgs[0] = function () {
1121
+ handler.dn();
1122
+ timerFn.apply(self, arguments);
1123
+ };
1124
+ var handler = _createTimerHandler(startTimer, function (timerId) {
1081
1125
  if (timerId) {
1082
1126
  if (timerId.refresh) {
1083
1127
  timerId.refresh();
@@ -1089,6 +1133,7 @@
1089
1133
  }, function (timerId) {
1090
1134
  clearFn.call(self, timerId);
1091
1135
  });
1136
+ return handler.h;
1092
1137
  }
1093
1138
  function scheduleTimeout(callback, timeout) {
1094
1139
  return _createTimeoutWith(this, true, UNDEF_VALUE, _extractArgs(arguments, 0));
@@ -1096,12 +1141,13 @@
1096
1141
  function scheduleInterval(callback, timeout) {
1097
1142
  var self = this;
1098
1143
  var theArguments = _extractArgs(arguments, 0);
1099
- return _createTimerHandler(true, function (intervalId) {
1144
+ var handler = _createTimerHandler(true, function (intervalId) {
1100
1145
  intervalId && clearInterval(intervalId);
1101
1146
  return setInterval.apply(self, theArguments);
1102
1147
  }, function (intervalId) {
1103
1148
  clearInterval(intervalId);
1104
1149
  });
1150
+ return handler.h;
1105
1151
  }
1106
1152
 
1107
1153
  var createEnumStyle = createEnum;
@@ -1568,7 +1614,7 @@
1568
1614
  }
1569
1615
 
1570
1616
  var _objDefineProperty = ObjDefineProperty;
1571
- var version = "3.0.0-beta.2302-06";
1617
+ var version = "3.0.0-beta.2303-02";
1572
1618
  var instanceName = "." + newId(6);
1573
1619
  var _dataUid = 0;
1574
1620
  function _createAccessor(target, prop, value) {
@@ -5847,7 +5893,7 @@
5847
5893
  }
5848
5894
  }
5849
5895
  var EnvelopeCreator = {
5850
- Version: "3.0.0-beta.2302-06"
5896
+ Version: "3.0.0-beta.2303-02"
5851
5897
  };
5852
5898
  function DependencyEnvelopeCreator(logger, telemetryItem, customUndefinedValue) {
5853
5899
  EnvelopeCreatorInit(logger, telemetryItem);