@microsoft/applicationinsights-analytics-js 3.0.0-beta.2302-03 → 3.0.0-beta.2302-04

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,7 +1,7 @@
1
1
  {
2
2
  "metadata": {
3
3
  "toolPackage": "@microsoft/api-extractor",
4
- "toolVersion": "7.34.2",
4
+ "toolVersion": "7.34.4",
5
5
  "schemaVersion": 1011,
6
6
  "oldestForwardsCompatibleVersion": 1001,
7
7
  "tsdocConfig": {
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Microsoft Application Insights JavaScript SDK - Web Analytics, 3.0.0-beta.2302-03
2
+ * Microsoft Application Insights JavaScript SDK - Web Analytics, 3.0.0-beta.2302-04
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 - Web Analytics, 3.0.0-beta.2302-03
2
+ * Application Insights JavaScript SDK - Web Analytics, 3.0.0-beta.2302-04
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -407,7 +407,8 @@
407
407
  return typeof value === theType;
408
408
  };
409
409
  }
410
- function _createObjIs(theType) {
410
+ function _createObjIs(theName) {
411
+ var theType = "[object " + theName + "]";
411
412
  return function (value) {
412
413
  return !!(value && objToString(value) === theType);
413
414
  };
@@ -434,7 +435,7 @@
434
435
  }
435
436
  var isArray = ArrCls.isArray;
436
437
  var isNumber = _createIs(NUMBER);
437
- var isError = _createObjIs("[object Error]");
438
+ var isError = _createObjIs("Error");
438
439
  function isTruthy(value) {
439
440
  return !(!value || _safeGet(function () { return !(value && (0 + value)); }, !value));
440
441
  }
@@ -462,6 +463,15 @@
462
463
  }
463
464
  }
464
465
 
466
+ function _createKeyValueMap(values, keyType, valueType, completeFn) {
467
+ var theMap = {};
468
+ objForEachKey(values, function (key, value) {
469
+ theMap[key] = keyType ? value : key;
470
+ theMap[value] = valueType ? value : key;
471
+ });
472
+ return completeFn(theMap);
473
+ }
474
+
465
475
  function throwError(message) {
466
476
  throw new Error(message);
467
477
  }
@@ -470,9 +480,7 @@
470
480
  }
471
481
 
472
482
  var _objFreeze = ObjClass["freeze"];
473
- function _doNothing(value) {
474
- return value;
475
- }
483
+ var _doNothing = function (value) { return value; };
476
484
  ObjClass["assign"];
477
485
  function objKeys(value) {
478
486
  if (!isObject(value) || value === null) {
@@ -495,12 +503,7 @@
495
503
  var objGetPrototypeOf = ObjClass["getPrototypeOf"] || _doNothing;
496
504
 
497
505
  function createEnum(values) {
498
- var theEnum = {};
499
- objForEachKey(values, function (field, value) {
500
- theEnum[field] = value;
501
- theEnum[value] = field;
502
- });
503
- return objDeepFreeze(theEnum);
506
+ return _createKeyValueMap(values, 1, 0, objDeepFreeze);
504
507
  }
505
508
 
506
509
  var asString = StrCls;
@@ -531,6 +534,67 @@
531
534
  return _globalCfg;
532
535
  }
533
536
 
537
+ function dumpObj(object, format) {
538
+ var propertyValueDump = "";
539
+ if (isError(object)) {
540
+ propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'";
541
+ }
542
+ else {
543
+ try {
544
+ propertyValueDump = JSON.stringify(object, null, format ? (isNumber(format) ? format : 4) : UNDEF_VALUE);
545
+ }
546
+ catch (e) {
547
+ propertyValueDump = " - " + dumpObj(e, format);
548
+ }
549
+ }
550
+ return objToString(object) + ": " + propertyValueDump;
551
+ }
552
+
553
+ function _extractArgs(args, startAt) {
554
+ var theArgs = [];
555
+ for (var lp = startAt; lp < args[LENGTH]; lp++) {
556
+ theArgs[lp - startAt] = args[lp];
557
+ }
558
+ return theArgs;
559
+ }
560
+
561
+ function _unwrapFunction(funcName) {
562
+ return function (thisArg) {
563
+ var args = _extractArgs(arguments, 1);
564
+ if ((thisArg || thisArg === EMPTY) && thisArg[funcName]) {
565
+ return thisArg[funcName].apply(thisArg, args);
566
+ }
567
+ throwTypeError("'" + funcName + "' not defined for " + dumpObj(thisArg));
568
+ };
569
+ }
570
+
571
+ var mathMax = MathCls.max;
572
+
573
+ var strSlice = _unwrapFunction("slice");
574
+
575
+ var SUB_STR = "substr";
576
+ var strSubstring = _unwrapFunction("substring");
577
+ var strSubstr = StrProto[SUB_STR] ? _unwrapFunction(SUB_STR) : polyStrSubstr;
578
+ function polyStrSubstr(value, start, length) {
579
+ if (isNullOrUndefined(value)) {
580
+ throwTypeError("'polyStrSubstr called with invalid " + dumpObj(value));
581
+ }
582
+ if (length < 0) {
583
+ return EMPTY;
584
+ }
585
+ start = start || 0;
586
+ if (start < 0) {
587
+ start = mathMax(start + value[LENGTH], 0);
588
+ }
589
+ if (isUndefined(length)) {
590
+ return strSlice(value, start);
591
+ }
592
+ return strSlice(value, start, start + length);
593
+ }
594
+ function strLeft(value, count) {
595
+ return strSubstring(value, 0, count);
596
+ }
597
+
534
598
  var _polySymbols;
535
599
  function _globalSymbolRegistry() {
536
600
  if (!_polySymbols) {
@@ -632,6 +696,9 @@
632
696
  var _cachedDocument;
633
697
  var _cachedNavigator;
634
698
  var _cachedHistory;
699
+ function _lazySafeGetInst(name) {
700
+ return _lazySafeGet(function () { return getInst(name) || UNDEF_VALUE; }, UNDEF_VALUE);
701
+ }
635
702
  function getGlobal(useCached) {
636
703
  (!_cachedGlobal || useCached === false || (_globalLazyTestHooks.lzy && !_cachedGlobal.b)) && (_cachedGlobal = _lazySafeGet(_getGlobalValue, null));
637
704
  return _cachedGlobal.v;
@@ -647,36 +714,41 @@
647
714
  return null;
648
715
  }
649
716
  function getDocument() {
650
- (!_cachedDocument || (_globalLazyTestHooks.lzy && !_cachedDocument.b)) && (_cachedDocument = _lazySafeGet(function () { return getInst(DOCUMENT); }, UNDEF_VALUE));
717
+ (!_cachedDocument || (_globalLazyTestHooks.lzy && !_cachedDocument.b)) && (_cachedDocument = _lazySafeGetInst(DOCUMENT));
651
718
  return _cachedDocument.v;
652
719
  }
653
720
  function hasWindow() {
654
721
  return !!getWindow();
655
722
  }
656
723
  function getWindow() {
657
- (!_cachedWindow || (_globalLazyTestHooks.lzy && !_cachedWindow.b)) && (_cachedWindow = _lazySafeGet(function () { return getInst(WINDOW); }, UNDEF_VALUE));
724
+ (!_cachedWindow || (_globalLazyTestHooks.lzy && !_cachedWindow.b)) && (_cachedWindow = _lazySafeGetInst(WINDOW));
658
725
  return _cachedWindow.v;
659
726
  }
660
727
  function getNavigator() {
661
- (!_cachedNavigator || (_globalLazyTestHooks.lzy && !_cachedNavigator.b)) && (_cachedNavigator = _lazySafeGet(function () { return getInst(NAVIGATOR); }, UNDEF_VALUE));
728
+ (!_cachedNavigator || (_globalLazyTestHooks.lzy && !_cachedNavigator.b)) && (_cachedNavigator = _lazySafeGetInst(NAVIGATOR));
662
729
  return _cachedNavigator.v;
663
730
  }
664
731
  function hasHistory() {
665
732
  return !!getHistory();
666
733
  }
667
734
  function getHistory() {
668
- (!_cachedHistory || (_globalLazyTestHooks.lzy && !_cachedHistory.b)) && (_cachedHistory = _lazySafeGet(function () { return getInst(HISTORY); }, UNDEF_VALUE));
735
+ (!_cachedHistory || (_globalLazyTestHooks.lzy && !_cachedHistory.b)) && (_cachedHistory = _lazySafeGetInst(HISTORY));
669
736
  return _cachedHistory.v;
670
737
  }
671
738
 
672
739
  var _symbol;
673
740
  var _symbolFor;
674
741
  var _symbolKeyFor;
742
+ function _getSymbolValue(name) {
743
+ return _lazySafeGet(function () {
744
+ return (_symbol.v ? _symbol[name] : UNDEF_VALUE);
745
+ }, UNDEF_VALUE);
746
+ }
675
747
  function getSymbol() {
676
748
  var resetCache = !_symbol || (_globalLazyTestHooks && _globalLazyTestHooks.lzy && !_symbol.b);
677
- resetCache && (_symbol = _lazySafeGet(function () { return isDefined(Symbol) ? getInst(SYMBOL) : UNDEF_VALUE; }, UNDEF_VALUE));
678
- (!_symbolFor || resetCache) && (_symbolFor = _lazySafeGet(function () { return _symbol.v ? _symbol["for"] : UNDEF_VALUE; }, UNDEF_VALUE));
679
- (!_symbolKeyFor || resetCache) && (_symbolKeyFor = _lazySafeGet(function () { return _symbol.v ? _symbol["keyFor"] : UNDEF_VALUE; }, UNDEF_VALUE));
749
+ resetCache && (_symbol = _lazySafeGetInst(SYMBOL));
750
+ (!_symbolFor || resetCache) && (_symbolFor = _getSymbolValue("for"));
751
+ (!_symbolKeyFor || resetCache) && (_symbolKeyFor = _getSymbolValue("keyFor"));
680
752
  return _symbol.v;
681
753
  }
682
754
  function newSymbol(description, noPoly) {
@@ -724,46 +796,6 @@
724
796
  }
725
797
  }
726
798
 
727
- function dumpObj(object, format) {
728
- var objectTypeDump = objToString(object);
729
- var propertyValueDump = "";
730
- if (objectTypeDump === "[object Error]") {
731
- propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'";
732
- }
733
- else {
734
- try {
735
- if (format) {
736
- if (isNumber(format)) {
737
- propertyValueDump = JSON.stringify(object, null, format);
738
- }
739
- else {
740
- propertyValueDump = JSON.stringify(object, null, 4);
741
- }
742
- }
743
- else {
744
- propertyValueDump = JSON.stringify(object);
745
- }
746
- }
747
- catch (e) {
748
- propertyValueDump = objToString(object) + " - " + dumpObj(e, format);
749
- }
750
- }
751
- return objectTypeDump + ": " + propertyValueDump;
752
- }
753
-
754
- function _unwrapFunction(funcName) {
755
- return function (thisArg) {
756
- var args = [];
757
- for (var _i = 1; _i < arguments.length; _i++) {
758
- args[_i - 1] = arguments[_i];
759
- }
760
- if ((thisArg || thisArg === EMPTY) && thisArg[funcName]) {
761
- return thisArg[funcName].apply(thisArg, args);
762
- }
763
- throwTypeError("'" + funcName + "' not defined for " + dumpObj(thisArg));
764
- };
765
- }
766
-
767
799
  var arrIndexOf = _unwrapFunction(INDEX_OF);
768
800
 
769
801
  var arrMap = _unwrapFunction("map");
@@ -774,9 +806,7 @@
774
806
  d.__proto__ = b;
775
807
  }) ||
776
808
  function (d, b) {
777
- objForEachKey(b, function (key, value) {
778
- d[key] = value;
779
- });
809
+ objForEachKey(b, function (key, value) { return d[key] = value; });
780
810
  };
781
811
  return fn(obj, proto);
782
812
  }
@@ -843,37 +873,10 @@
843
873
 
844
874
  var _perf;
845
875
  function getPerformance() {
846
- (!_perf || (_globalLazyTestHooks.lzy && !_perf.b)) && (_perf = _lazySafeGet(function () { return getInst("performance"); }, UNDEF_VALUE));
876
+ (!_perf || (_globalLazyTestHooks.lzy && !_perf.b)) && (_perf = _lazySafeGetInst("performance"));
847
877
  return _perf.v;
848
878
  }
849
879
 
850
- var mathMax = MathCls.max;
851
-
852
- var strSlice = _unwrapFunction("slice");
853
-
854
- var SUB_STR = "substr";
855
- var strSubstring = _unwrapFunction("substring");
856
- var strSubstr = StrProto[SUB_STR] ? _unwrapFunction(SUB_STR) : polyStrSubstr;
857
- function polyStrSubstr(value, start, length) {
858
- if (isNullOrUndefined(value)) {
859
- throwTypeError("'polyStrSubstr called with invalid " + dumpObj(value));
860
- }
861
- if (length < 0) {
862
- return EMPTY;
863
- }
864
- start = start || 0;
865
- if (start < 0) {
866
- start = mathMax(start + value[LENGTH], 0);
867
- }
868
- if (isUndefined(length)) {
869
- return strSlice(value, start);
870
- }
871
- return strSlice(value, start, start + length);
872
- }
873
- function strLeft(value, count) {
874
- return strSubstring(value, 0, count);
875
- }
876
-
877
880
  var ENDS_WITH = "endsWith";
878
881
  var strEndsWith = StrProto[ENDS_WITH] ? _unwrapFunction(ENDS_WITH) : polyStrEndsWith;
879
882
  function polyStrEndsWith(value, searchString, length) {
@@ -943,14 +946,6 @@
943
946
  return timer;
944
947
  }
945
948
 
946
- function _extractArgs(args, startAt) {
947
- var theArgs = [];
948
- for (var lp = startAt; lp < args[LENGTH]; lp++) {
949
- theArgs[lp - startAt] = args[lp];
950
- }
951
- return theArgs;
952
- }
953
-
954
949
  function _createTimeoutWith(self, startTimer, overrideFn, theArgs) {
955
950
  var isArr = isArray(overrideFn);
956
951
  var len = isArr ? overrideFn.length : 0;
@@ -1249,7 +1244,7 @@
1249
1244
  }
1250
1245
 
1251
1246
  var _objDefineProperty = ObjDefineProperty;
1252
- var version = "3.0.0-beta.2302-03";
1247
+ var version = "3.0.0-beta.2302-04";
1253
1248
  var instanceName = "." + newId(6);
1254
1249
  var _dataUid = 0;
1255
1250
  function _createAccessor(target, prop, value) {
@@ -5304,7 +5299,7 @@
5304
5299
  });
5305
5300
  return _this;
5306
5301
  }
5307
- AnalyticsPlugin.Version = "3.0.0-beta.2302-03";
5302
+ AnalyticsPlugin.Version = "3.0.0-beta.2302-04";
5308
5303
  return AnalyticsPlugin;
5309
5304
  }(BaseTelemetryPlugin));
5310
5305