@microsoft/applicationinsights-dependencies-js 2.7.3 → 2.7.4-nightly.2202-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, 2.7.3
2
+ * Microsoft Application Insights XHR dependencies plugin, 2.7.4-nightly.2202-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, 2.7.3
2
+ * Application Insights JavaScript SDK - Dependencies Plugin, 2.7.4-nightly.2202-03
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  (function (global, factory) {
@@ -429,9 +429,37 @@
429
429
  var strAttachEvent = "attachEvent";
430
430
  var strAddEventHelper = "addEventListener";
431
431
  var strToISOString = "toISOString";
432
+ var cStrTrim = "trim";
433
+ var strKeys = "keys";
434
+ var strToString = "toString";
435
+ var str__Proto = "__proto__";
436
+ var strConstructor = "constructor";
432
437
  var _objDefineProperty = ObjDefineProperty;
438
+ var StringProto = String[strShimPrototype];
439
+ var _strTrim = StringProto[cStrTrim];
440
+ var DateProto = Date[strShimPrototype];
441
+ var _dataToISOString = DateProto[strToISOString];
442
+ var _isArray = Array.isArray;
443
+ var _fnToString = ObjHasOwnProperty[strToString];
444
+ _fnToString.call(ObjClass);
445
+ var rCamelCase = /-([a-z])/g;
446
+ var rNormalizeInvalid = /([^\w\d_$])/g;
447
+ var rLeadingNumeric = /^(\d+[\w\d_$])/;
448
+ var _objGetPrototypeOf = Object["getPrototypeOf"];
449
+ function _getObjProto(target) {
450
+ if (target) {
451
+ if (_objGetPrototypeOf) {
452
+ return _objGetPrototypeOf(target);
453
+ }
454
+ var newProto = target[str__Proto] || target[strShimPrototype] || target[strConstructor];
455
+ if (newProto) {
456
+ return newProto;
457
+ }
458
+ }
459
+ return null;
460
+ }
433
461
  function objToString(obj) {
434
- return ObjProto.toString.call(obj);
462
+ return ObjProto[strToString].call(obj);
435
463
  }
436
464
  function isUndefined(value) {
437
465
  return value === undefined || typeof value === strShimUndefined;
@@ -440,13 +468,13 @@
440
468
  return (value === null || isUndefined(value));
441
469
  }
442
470
  function hasOwnProperty(obj, prop) {
443
- return obj && ObjHasOwnProperty.call(obj, prop);
471
+ return !!(obj && ObjHasOwnProperty.call(obj, prop));
444
472
  }
445
473
  function isObject(value) {
446
- return typeof value === strShimObject;
474
+ return !!(value && typeof value === strShimObject);
447
475
  }
448
476
  function isFunction(value) {
449
- return typeof value === strShimFunction;
477
+ return !!(value && typeof value === strShimFunction);
450
478
  }
451
479
  function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
452
480
  if (useCapture === void 0) { useCapture = false; }
@@ -469,9 +497,14 @@
469
497
  }
470
498
  function normalizeJsName(name) {
471
499
  var value = name;
472
- var match = /([^\w\d_$])/g;
473
- if (match.test(name)) {
474
- value = name.replace(match, "_");
500
+ if (value && isString(value)) {
501
+ value = value.replace(rCamelCase, function (_all, letter) {
502
+ return letter.toUpperCase();
503
+ });
504
+ value = value.replace(rNormalizeInvalid, "_");
505
+ value = value.replace(rLeadingNumeric, function (_all, match) {
506
+ return "_" + match;
507
+ });
475
508
  }
476
509
  return value;
477
510
  }
@@ -490,11 +523,8 @@
490
523
  }
491
524
  return false;
492
525
  }
493
- function isDate(obj) {
494
- return objToString(obj) === "[object Date]";
495
- }
496
526
  function isArray(obj) {
497
- return objToString(obj) === "[object Array]";
527
+ return _isArray ? _isArray(obj) : !!(obj && objToString(obj) === "[object Array]");
498
528
  }
499
529
  function isString(value) {
500
530
  return typeof value === "string";
@@ -504,26 +534,26 @@
504
534
  }
505
535
  function toISOString(date) {
506
536
  if (date) {
507
- if (date[strToISOString]) {
508
- return date[strToISOString]();
509
- }
510
- if (isDate(date)) {
511
- var pad = function (num) {
512
- var r = String(num);
513
- if (r.length === 1) {
514
- r = "0" + r;
515
- }
516
- return r;
517
- };
518
- return date.getUTCFullYear()
519
- + "-" + pad(date.getUTCMonth() + 1)
520
- + "-" + pad(date.getUTCDate())
521
- + "T" + pad(date.getUTCHours())
522
- + ":" + pad(date.getUTCMinutes())
523
- + ":" + pad(date.getUTCSeconds())
524
- + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5)
525
- + "Z";
526
- }
537
+ return _dataToISOString ? date[strToISOString]() : _toISOStringPoly(date);
538
+ }
539
+ }
540
+ function _toISOStringPoly(date) {
541
+ if (date && date.getUTCFullYear) {
542
+ var pad = function (num) {
543
+ var r = String(num);
544
+ if (r.length === 1) {
545
+ r = "0" + r;
546
+ }
547
+ return r;
548
+ };
549
+ return date.getUTCFullYear()
550
+ + "-" + pad(date.getUTCMonth() + 1)
551
+ + "-" + pad(date.getUTCDate())
552
+ + "T" + pad(date.getUTCHours())
553
+ + ":" + pad(date.getUTCMinutes())
554
+ + ":" + pad(date.getUTCSeconds())
555
+ + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5)
556
+ + "Z";
527
557
  }
528
558
  }
529
559
  function arrForEach(arr, callbackfn, thisArg) {
@@ -541,10 +571,10 @@
541
571
  }
542
572
  }
543
573
  function strTrim(str) {
544
- if (typeof str !== "string") {
545
- return str;
574
+ if (str) {
575
+ str = (_strTrim && str[cStrTrim]) ? str[cStrTrim]() : (str.replace ? str.replace(/^\s+|\s+$/g, "") : str);
546
576
  }
547
- return str.replace(/^\s+|\s+$/g, "");
577
+ return str;
548
578
  }
549
579
  var _objKeysHasDontEnumBug = !({ toString: null }).propertyIsEnumerable("toString");
550
580
  var _objKeysDontEnums = [
@@ -561,6 +591,9 @@
561
591
  if (objType !== strShimFunction && (objType !== strShimObject || obj === null)) {
562
592
  throwTypeError("objKeys called on non-object");
563
593
  }
594
+ if (!_objKeysHasDontEnumBug && obj[strKeys]) {
595
+ return obj[strKeys];
596
+ }
564
597
  var result = [];
565
598
  for (var prop in obj) {
566
599
  if (obj && ObjHasOwnProperty.call(obj, prop)) {
@@ -600,10 +633,7 @@
600
633
  }
601
634
  function dateNow() {
602
635
  var dt = Date;
603
- if (dt.now) {
604
- return dt.now();
605
- }
606
- return new dt().getTime();
636
+ return dt.now ? dt.now() : new dt().getTime();
607
637
  }
608
638
  function setValue(target, field, value, valChk, srcChk) {
609
639
  var theValue = value;
@@ -1350,8 +1380,6 @@
1350
1380
  var cbNames = [
1351
1381
  "req", "rsp", "hkErr", "fnErr"
1352
1382
  ];
1353
- var str__Proto = "__proto__";
1354
- var strConstructor = "constructor";
1355
1383
  function _arrLoop(arr, fn) {
1356
1384
  if (arr) {
1357
1385
  for (var lp = 0; lp < arr.length; lp++) {
@@ -1431,19 +1459,6 @@
1431
1459
  return funcArgs.rslt;
1432
1460
  };
1433
1461
  }
1434
- var _objGetPrototypeOf = Object["getPrototypeOf"];
1435
- function _getObjProto(target) {
1436
- if (target) {
1437
- if (_objGetPrototypeOf) {
1438
- return _objGetPrototypeOf(target);
1439
- }
1440
- var newProto = target[str__Proto] || target[strShimPrototype] || target[strConstructor];
1441
- if (newProto) {
1442
- return newProto;
1443
- }
1444
- }
1445
- return null;
1446
- }
1447
1462
  function _getOwner(target, name, checkPrototype) {
1448
1463
  var owner = null;
1449
1464
  if (target) {