@microsoft/applicationinsights-properties-js 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,25 +1,25 @@
1
1
  {
2
2
  "name": "applicationinsights-properties-js",
3
- "version": "3.0.0-beta.2302-06",
3
+ "version": "3.0.0-beta.2303-02",
4
4
  "ext": {
5
5
  "@js": {
6
6
  "file": "applicationinsights-properties-js.js",
7
7
  "type": "text/javascript; charset=utf-8",
8
- "integrity": "sha256-vIZ5X08OLRpMYihn85DUQrKrGiXYKIsLYW12b6dd9y8= sha384-ePgTPBtAaOoMOradxHbKzkVOyqVZItSriDxSirKVkelM62S3BbbTstQN8K0W9pjs sha512-1SVD6VOQZ3jTT1WkZ+bsMaDMAixB3zjGa2oLeJVLU2Ei3XzHBsbUnvJlkqfN/FSw4HdBKCmcu+dTApkuWudSmw==",
8
+ "integrity": "sha256-LOBHBMXrm6uxeZQbUc3YTWld4ztXHRN9sp8JCxFqKMQ= sha384-qIigno316y31XaP39UA1u2RJric/gchN4LE4F0bNQI7M1836QXuWir6zyDFdRFxm sha512-N/c95gyT+0ox8kKFyjwzBaVLrECj/4tFJI6OHp7KyKZ/DpWSQpybj11f9oCC9qx7+Pfgk8L7GC7Wp8gv8tiKwQ==",
9
9
  "hashes": {
10
- "sha256": "vIZ5X08OLRpMYihn85DUQrKrGiXYKIsLYW12b6dd9y8=",
11
- "sha384": "ePgTPBtAaOoMOradxHbKzkVOyqVZItSriDxSirKVkelM62S3BbbTstQN8K0W9pjs",
12
- "sha512": "1SVD6VOQZ3jTT1WkZ+bsMaDMAixB3zjGa2oLeJVLU2Ei3XzHBsbUnvJlkqfN/FSw4HdBKCmcu+dTApkuWudSmw=="
10
+ "sha256": "LOBHBMXrm6uxeZQbUc3YTWld4ztXHRN9sp8JCxFqKMQ=",
11
+ "sha384": "qIigno316y31XaP39UA1u2RJric/gchN4LE4F0bNQI7M1836QXuWir6zyDFdRFxm",
12
+ "sha512": "N/c95gyT+0ox8kKFyjwzBaVLrECj/4tFJI6OHp7KyKZ/DpWSQpybj11f9oCC9qx7+Pfgk8L7GC7Wp8gv8tiKwQ=="
13
13
  }
14
14
  },
15
15
  "@min.js": {
16
16
  "file": "applicationinsights-properties-js.min.js",
17
17
  "type": "text/javascript; charset=utf-8",
18
- "integrity": "sha256-7YObAp8Ja+fzxU1GWgQNUiLd1/JmCEMmER0DmrUTOdw= sha384-V1oewNN5e0SP998w4aLwzWHm0SK95bl5r9Hk6hCTxiWib/4aFBL/gpT88XJx8TkT sha512-mLyZZXDdMmna6E39Zh+PR7UI81kGkpxKM8IFUA73njW4uz98WolLEI9ujVp9blUoPb+5n2ta/GkwsnBlahH1lw==",
18
+ "integrity": "sha256-8K+5UejRxc28a7/HfCCyMsF3E9Z0ZVw3Dt0dmLQUevk= sha384-7Zwi8PVcLQGQ/JWGPrRT189AwtHbtYi8H77LQ5AmCAajT0oQUb/nNJ2G0Bbz6B2T sha512-pcnoS4nH7H79658JH6gOyqqPSbMjZCsH8wYyR8Qe2E4IvBcq0HuEXwxJReGO3Vqj0sPjAr64x31hSS4mkJfAhQ==",
19
19
  "hashes": {
20
- "sha256": "7YObAp8Ja+fzxU1GWgQNUiLd1/JmCEMmER0DmrUTOdw=",
21
- "sha384": "V1oewNN5e0SP998w4aLwzWHm0SK95bl5r9Hk6hCTxiWib/4aFBL/gpT88XJx8TkT",
22
- "sha512": "mLyZZXDdMmna6E39Zh+PR7UI81kGkpxKM8IFUA73njW4uz98WolLEI9ujVp9blUoPb+5n2ta/GkwsnBlahH1lw=="
20
+ "sha256": "8K+5UejRxc28a7/HfCCyMsF3E9Z0ZVw3Dt0dmLQUevk=",
21
+ "sha384": "7Zwi8PVcLQGQ/JWGPrRT189AwtHbtYi8H77LQ5AmCAajT0oQUb/nNJ2G0Bbz6B2T",
22
+ "sha512": "pcnoS4nH7H79658JH6gOyqqPSbMjZCsH8wYyR8Qe2E4IvBcq0HuEXwxJReGO3Vqj0sPjAr64x31hSS4mkJfAhQ=="
23
23
  }
24
24
  }
25
25
  }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Application Insights JavaScript SDK - Properties Plugin, 3.0.0-beta.2302-06
2
+ * Application Insights JavaScript SDK - Properties Plugin, 3.0.0-beta.2303-02
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -86,7 +86,7 @@
86
86
  }
87
87
 
88
88
  /*!
89
- * Microsoft Dynamic Proto Utility, 1.1.7
89
+ * Microsoft Dynamic Proto Utility, 1.1.8
90
90
  * Copyright (c) Microsoft and contributors. All rights reserved.
91
91
  */
92
92
  var _a$4;
@@ -356,7 +356,7 @@
356
356
  dynamicProto[DynProtoDefaultOptions] = _gblInst.o;
357
357
 
358
358
  /*!
359
- * NevWare21 - ts-utils, 0.8.0
359
+ * NevWare21 - ts-utils, 0.8.1
360
360
  * https://github.com/nevware21/ts-utils
361
361
  * Copyright (c) NevWare21 and contributors. All rights reserved.
362
362
  * Licensed under the MIT license.
@@ -377,6 +377,7 @@
377
377
  var LENGTH = "length";
378
378
  var DONE = "done";
379
379
  var VALUE = "value";
380
+ var NAME = "name";
380
381
  var ObjClass = Object;
381
382
  var ObjProto = ObjClass[PROTOTYPE];
382
383
  var StrCls = String;
@@ -780,22 +781,37 @@
780
781
  };
781
782
  return fn(obj, proto);
782
783
  }
783
- function _createCustomError(name, d, b) {
784
- objSetPrototypeOf(d, b);
784
+ function _createCustomError(name, d, baseClass) {
785
+ objSetPrototypeOf(d, baseClass);
785
786
  function __() {
786
787
  this.constructor = d;
788
+ this[NAME] = name;
787
789
  }
788
- __[PROTOTYPE] = b[PROTOTYPE];
789
- __[PROTOTYPE].name = name;
790
+ __[PROTOTYPE] = baseClass[PROTOTYPE];
790
791
  d[PROTOTYPE] = new __();
791
792
  return d;
792
793
  }
794
+ var _safeSetName = function (baseClass, name) {
795
+ try {
796
+ baseClass[PROTOTYPE][NAME] = name;
797
+ }
798
+ catch (e) {
799
+ }
800
+ };
793
801
  function createCustomError(name, constructCb) {
794
802
  var baseClass = Error;
803
+ var orgName = baseClass[PROTOTYPE][NAME];
795
804
  var customError = _createCustomError(name, function () {
796
805
  var _this = this;
797
- _this = baseClass.apply(_this, arguments) || _this;
798
- constructCb && constructCb(_this, arguments);
806
+ try {
807
+ _safeSetName(baseClass, name);
808
+ _this = baseClass.apply(_this, arguments) || _this;
809
+ _this[NAME] = name;
810
+ constructCb && constructCb(_this, arguments);
811
+ }
812
+ finally {
813
+ _safeSetName(baseClass, orgName);
814
+ }
799
815
  return _this;
800
816
  }, baseClass);
801
817
  return customError;
@@ -864,49 +880,77 @@
864
880
  var polyStrTrim = _createTrimFn(/^\s+|(?=\s)\s+$/g);
865
881
  var TRIM = "trim";
866
882
  var strTrim = _unwrapFunction(TRIM, UNDEF_VALUE, polyStrTrim);
883
+ var REF = "ref";
884
+ var UNREF = "un" + REF;
885
+ var HAS_REF = "hasRef";
886
+ var ENABLED = "enabled";
867
887
  function _createTimerHandler(startTimer, refreshFn, cancelFn) {
888
+ var _a;
868
889
  var ref = true;
869
890
  var timerId = startTimer ? refreshFn(null) : null;
870
- function _unref() {
891
+ var theTimerHandler;
892
+ var _unref = function () {
871
893
  ref = false;
872
- timerId && timerId["unref"] && timerId["unref"]();
873
- return timer;
874
- }
875
- function _ref() {
894
+ timerId && timerId[UNREF] && timerId[UNREF]();
895
+ return theTimerHandler;
896
+ };
897
+ var _ref = function () {
876
898
  ref = true;
877
- timerId && timerId["ref"] && timerId["ref"]();
878
- return timer;
879
- }
880
- function _hasRef() {
881
- if (timerId && timerId["hasRef"]) {
882
- return timerId["hasRef"]();
899
+ timerId && timerId[REF] && timerId[REF]();
900
+ return theTimerHandler;
901
+ };
902
+ var _hasRef = function () {
903
+ if (timerId && timerId[HAS_REF]) {
904
+ return timerId[HAS_REF]();
883
905
  }
884
906
  return ref;
885
- }
886
- var timer = {
887
- cancel: function () {
888
- timerId && cancelFn(timerId);
889
- timerId = null;
890
- },
891
- refresh: function () {
892
- timerId = refreshFn(timerId);
893
- if (!ref) {
894
- _unref();
895
- }
896
- return timer;
907
+ };
908
+ var _refresh = function () {
909
+ timerId = refreshFn(timerId);
910
+ if (!ref) {
911
+ _unref();
912
+ }
913
+ return theTimerHandler;
914
+ };
915
+ var _cancel = function () {
916
+ timerId && cancelFn(timerId);
917
+ timerId = null;
918
+ };
919
+ var _setEnabled = function (value) {
920
+ !value && timerId && _cancel();
921
+ value && !timerId && _refresh();
922
+ };
923
+ theTimerHandler = (_a = {
924
+ cancel: _cancel,
925
+ refresh: _refresh
897
926
  },
898
- hasRef: _hasRef,
899
- ref: _ref,
900
- unref: _unref
927
+ _a[HAS_REF] = _hasRef,
928
+ _a[REF] = _ref,
929
+ _a[UNREF] = _unref,
930
+ _a[ENABLED] = false,
931
+ _a);
932
+ objDefineProp(theTimerHandler, ENABLED, {
933
+ get: function () { return !!timerId; },
934
+ set: _setEnabled
935
+ });
936
+ return {
937
+ h: theTimerHandler,
938
+ dn: function () {
939
+ timerId = null;
940
+ }
901
941
  };
902
- return timer;
903
942
  }
904
943
  function _createTimeoutWith(self, startTimer, overrideFn, theArgs) {
905
944
  var isArr = isArray(overrideFn);
906
945
  var len = isArr ? overrideFn.length : 0;
907
946
  var setFn = (len > 0 ? overrideFn[0] : (!isArr ? overrideFn : UNDEF_VALUE)) || setTimeout;
908
947
  var clearFn = (len > 1 ? overrideFn[1] : UNDEF_VALUE) || clearTimeout;
909
- return _createTimerHandler(startTimer, function (timerId) {
948
+ var timerFn = theArgs[0];
949
+ theArgs[0] = function () {
950
+ handler.dn();
951
+ timerFn.apply(self, arguments);
952
+ };
953
+ var handler = _createTimerHandler(startTimer, function (timerId) {
910
954
  if (timerId) {
911
955
  if (timerId.refresh) {
912
956
  timerId.refresh();
@@ -918,6 +962,7 @@
918
962
  }, function (timerId) {
919
963
  clearFn.call(self, timerId);
920
964
  });
965
+ return handler.h;
921
966
  }
922
967
  function scheduleTimeout(callback, timeout) {
923
968
  return _createTimeoutWith(this, true, UNDEF_VALUE, _extractArgs(arguments, 0));
@@ -1220,7 +1265,7 @@
1220
1265
  }
1221
1266
 
1222
1267
  var _objDefineProperty = ObjDefineProperty;
1223
- var version = "3.0.0-beta.2302-06";
1268
+ var version = "3.0.0-beta.2303-02";
1224
1269
  var instanceName = "." + newId(6);
1225
1270
  var _dataUid = 0;
1226
1271
  function _createAccessor(target, prop, value) {