@microsoft/applicationinsights-dependencies-js 3.0.0-beta.2302-06 → 3.0.0-beta.2303-03

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.2302-06
2
+ * Microsoft Application Insights XHR dependencies plugin, 3.0.0-beta.2303-03
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.2302-06
2
+ * Application Insights JavaScript SDK - Dependencies Plugin, 3.0.0-beta.2303-03
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -100,7 +100,7 @@
100
100
  }
101
101
 
102
102
  /*!
103
- * Microsoft Dynamic Proto Utility, 1.1.7
103
+ * Microsoft Dynamic Proto Utility, 1.1.8
104
104
  * Copyright (c) Microsoft and contributors. All rights reserved.
105
105
  */
106
106
  var _a$3;
@@ -370,7 +370,7 @@
370
370
  dynamicProto[DynProtoDefaultOptions] = _gblInst.o;
371
371
 
372
372
  /*!
373
- * NevWare21 - ts-utils, 0.8.0
373
+ * NevWare21 - ts-utils, 0.8.1
374
374
  * https://github.com/nevware21/ts-utils
375
375
  * Copyright (c) NevWare21 and contributors. All rights reserved.
376
376
  * Licensed under the MIT license.
@@ -391,6 +391,7 @@
391
391
  var LENGTH = "length";
392
392
  var DONE = "done";
393
393
  var VALUE = "value";
394
+ var NAME = "name";
394
395
  var ObjClass = Object;
395
396
  var ObjProto = ObjClass[PROTOTYPE];
396
397
  var StrCls = String;
@@ -807,22 +808,37 @@
807
808
  };
808
809
  return fn(obj, proto);
809
810
  }
810
- function _createCustomError(name, d, b) {
811
- objSetPrototypeOf(d, b);
811
+ function _createCustomError(name, d, baseClass) {
812
+ objSetPrototypeOf(d, baseClass);
812
813
  function __() {
813
814
  this.constructor = d;
815
+ this[NAME] = name;
814
816
  }
815
- __[PROTOTYPE] = b[PROTOTYPE];
816
- __[PROTOTYPE].name = name;
817
+ __[PROTOTYPE] = baseClass[PROTOTYPE];
817
818
  d[PROTOTYPE] = new __();
818
819
  return d;
819
820
  }
821
+ var _safeSetName = function (baseClass, name) {
822
+ try {
823
+ baseClass[PROTOTYPE][NAME] = name;
824
+ }
825
+ catch (e) {
826
+ }
827
+ };
820
828
  function createCustomError(name, constructCb) {
821
829
  var baseClass = Error;
830
+ var orgName = baseClass[PROTOTYPE][NAME];
822
831
  var customError = _createCustomError(name, function () {
823
832
  var _this = this;
824
- _this = baseClass.apply(_this, arguments) || _this;
825
- constructCb && constructCb(_this, arguments);
833
+ try {
834
+ _safeSetName(baseClass, name);
835
+ _this = baseClass.apply(_this, arguments) || _this;
836
+ _this[NAME] = name;
837
+ constructCb && constructCb(_this, arguments);
838
+ }
839
+ finally {
840
+ _safeSetName(baseClass, orgName);
841
+ }
826
842
  return _this;
827
843
  }, baseClass);
828
844
  return customError;
@@ -884,49 +900,77 @@
884
900
  var polyStrTrim = _createTrimFn(/^\s+|(?=\s)\s+$/g);
885
901
  var TRIM = "trim";
886
902
  var strTrim = _unwrapFunction(TRIM, UNDEF_VALUE, polyStrTrim);
903
+ var REF = "ref";
904
+ var UNREF = "un" + REF;
905
+ var HAS_REF = "hasRef";
906
+ var ENABLED = "enabled";
887
907
  function _createTimerHandler(startTimer, refreshFn, cancelFn) {
908
+ var _a;
888
909
  var ref = true;
889
910
  var timerId = startTimer ? refreshFn(null) : null;
890
- function _unref() {
911
+ var theTimerHandler;
912
+ var _unref = function () {
891
913
  ref = false;
892
- timerId && timerId["unref"] && timerId["unref"]();
893
- return timer;
894
- }
895
- function _ref() {
914
+ timerId && timerId[UNREF] && timerId[UNREF]();
915
+ return theTimerHandler;
916
+ };
917
+ var _ref = function () {
896
918
  ref = true;
897
- timerId && timerId["ref"] && timerId["ref"]();
898
- return timer;
899
- }
900
- function _hasRef() {
901
- if (timerId && timerId["hasRef"]) {
902
- return timerId["hasRef"]();
919
+ timerId && timerId[REF] && timerId[REF]();
920
+ return theTimerHandler;
921
+ };
922
+ var _hasRef = function () {
923
+ if (timerId && timerId[HAS_REF]) {
924
+ return timerId[HAS_REF]();
903
925
  }
904
926
  return ref;
905
- }
906
- var timer = {
907
- cancel: function () {
908
- timerId && cancelFn(timerId);
909
- timerId = null;
910
- },
911
- refresh: function () {
912
- timerId = refreshFn(timerId);
913
- if (!ref) {
914
- _unref();
915
- }
916
- return timer;
927
+ };
928
+ var _refresh = function () {
929
+ timerId = refreshFn(timerId);
930
+ if (!ref) {
931
+ _unref();
932
+ }
933
+ return theTimerHandler;
934
+ };
935
+ var _cancel = function () {
936
+ timerId && cancelFn(timerId);
937
+ timerId = null;
938
+ };
939
+ var _setEnabled = function (value) {
940
+ !value && timerId && _cancel();
941
+ value && !timerId && _refresh();
942
+ };
943
+ theTimerHandler = (_a = {
944
+ cancel: _cancel,
945
+ refresh: _refresh
917
946
  },
918
- hasRef: _hasRef,
919
- ref: _ref,
920
- unref: _unref
947
+ _a[HAS_REF] = _hasRef,
948
+ _a[REF] = _ref,
949
+ _a[UNREF] = _unref,
950
+ _a[ENABLED] = false,
951
+ _a);
952
+ objDefineProp(theTimerHandler, ENABLED, {
953
+ get: function () { return !!timerId; },
954
+ set: _setEnabled
955
+ });
956
+ return {
957
+ h: theTimerHandler,
958
+ dn: function () {
959
+ timerId = null;
960
+ }
921
961
  };
922
- return timer;
923
962
  }
924
963
  function _createTimeoutWith(self, startTimer, overrideFn, theArgs) {
925
964
  var isArr = isArray(overrideFn);
926
965
  var len = isArr ? overrideFn.length : 0;
927
966
  var setFn = (len > 0 ? overrideFn[0] : (!isArr ? overrideFn : UNDEF_VALUE)) || setTimeout;
928
967
  var clearFn = (len > 1 ? overrideFn[1] : UNDEF_VALUE) || clearTimeout;
929
- return _createTimerHandler(startTimer, function (timerId) {
968
+ var timerFn = theArgs[0];
969
+ theArgs[0] = function () {
970
+ handler.dn();
971
+ timerFn.apply(self, arguments);
972
+ };
973
+ var handler = _createTimerHandler(startTimer, function (timerId) {
930
974
  if (timerId) {
931
975
  if (timerId.refresh) {
932
976
  timerId.refresh();
@@ -938,6 +982,7 @@
938
982
  }, function (timerId) {
939
983
  clearFn.call(self, timerId);
940
984
  });
985
+ return handler.h;
941
986
  }
942
987
  function scheduleTimeout(callback, timeout) {
943
988
  return _createTimeoutWith(this, true, UNDEF_VALUE, _extractArgs(arguments, 0));
@@ -1252,7 +1297,7 @@
1252
1297
  }
1253
1298
 
1254
1299
  var _objDefineProperty = ObjDefineProperty;
1255
- var version = "3.0.0-beta.2302-06";
1300
+ var version = "3.0.0-beta.2303-03";
1256
1301
  var instanceName = "." + newId(6);
1257
1302
  var _dataUid = 0;
1258
1303
  function _createAccessor(target, prop, value) {
@@ -3801,7 +3846,6 @@
3801
3846
  _a.duration = self[_DYN_AJAX_TOTAL_DURATION ],
3802
3847
  _a.success = (+(self[_DYN_STATUS ])) >= 200 && (+(self[_DYN_STATUS ])) < 400,
3803
3848
  _a.responseCode = (+(self[_DYN_STATUS ])),
3804
- _a.method = self[_DYN_METHOD ],
3805
3849
  _a[STR_PROPERTIES] = { HttpMethod: self[_DYN_METHOD ] },
3806
3850
  _a);
3807
3851
  var props = dependency[STR_PROPERTIES];