@microsoft/applicationinsights-core-js 2.7.4-nightly.2202-03 → 2.7.4-nightly.2202-05

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.
Files changed (54) hide show
  1. package/browser/applicationinsights-core-js.integrity.json +9 -9
  2. package/browser/applicationinsights-core-js.js +12 -14
  3. package/browser/applicationinsights-core-js.js.map +1 -1
  4. package/browser/applicationinsights-core-js.min.js +2 -2
  5. package/browser/applicationinsights-core-js.min.js.map +1 -1
  6. package/dist/applicationinsights-core-js.api.json +27 -136
  7. package/dist/applicationinsights-core-js.api.md +3 -3
  8. package/dist/applicationinsights-core-js.d.ts +4 -4
  9. package/dist/applicationinsights-core-js.js +12 -14
  10. package/dist/applicationinsights-core-js.js.map +1 -1
  11. package/dist/applicationinsights-core-js.min.js +2 -2
  12. package/dist/applicationinsights-core-js.min.js.map +1 -1
  13. package/dist/applicationinsights-core-js.rollup.d.ts +4 -4
  14. package/dist-esm/JavaScriptSDK/AppInsightsCore.js +1 -1
  15. package/dist-esm/JavaScriptSDK/BaseCore.js +1 -1
  16. package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +1 -1
  17. package/dist-esm/JavaScriptSDK/ChannelController.js +1 -1
  18. package/dist-esm/JavaScriptSDK/Constants.js +1 -1
  19. package/dist-esm/JavaScriptSDK/CookieMgr.js +1 -1
  20. package/dist-esm/JavaScriptSDK/CoreUtils.js +1 -1
  21. package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
  22. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +1 -1
  23. package/dist-esm/JavaScriptSDK/EnvUtils.js +1 -1
  24. package/dist-esm/JavaScriptSDK/HelperFuncs.js +19 -17
  25. package/dist-esm/JavaScriptSDK/HelperFuncs.js.map +1 -1
  26. package/dist-esm/JavaScriptSDK/InstrumentHooks.js +1 -1
  27. package/dist-esm/JavaScriptSDK/NotificationManager.js +1 -1
  28. package/dist-esm/JavaScriptSDK/PerfManager.js +1 -1
  29. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +1 -1
  30. package/dist-esm/JavaScriptSDK/RandomHelper.js +1 -1
  31. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +1 -1
  32. package/dist-esm/JavaScriptSDK/TelemetryPluginChain.js +1 -1
  33. package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
  34. package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +1 -1
  35. package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
  36. package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
  37. package/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
  38. package/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
  39. package/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
  40. package/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
  41. package/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
  42. package/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
  43. package/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
  44. package/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
  45. package/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
  46. package/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
  47. package/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
  48. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
  49. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
  50. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -1
  51. package/dist-esm/applicationinsights-core-js.js +1 -1
  52. package/package.json +1 -1
  53. package/src/JavaScriptSDK/HelperFuncs.ts +18 -17
  54. package/types/JavaScriptSDK/HelperFuncs.d.ts +3 -3
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Application Insights JavaScript SDK - Core, 2.7.4-nightly.2202-03
2
+ * Application Insights JavaScript SDK - Core, 2.7.4-nightly.2202-05
3
3
  * Copyright (c) Microsoft and contributors. All rights reserved.
4
4
  */
5
5
  export { MinChannelPriorty } from "./JavaScriptSDK.Interfaces/IChannelControls";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@microsoft/applicationinsights-core-js",
3
3
  "author": "Microsoft Application Insights Team",
4
- "version": "2.7.4-nightly.2202-03",
4
+ "version": "2.7.4-nightly.2202-05",
5
5
  "description": "Microsoft Application Insights Core Javascript SDK",
6
6
  "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
7
7
  "keywords": [
@@ -47,6 +47,7 @@ const _strStartsWith = StringProto[cStrStartsWith];
47
47
  const DateProto = Date[strShimPrototype];
48
48
  const _dataToISOString = DateProto[strToISOString];
49
49
  const _isArray = Array.isArray;
50
+ const _objToString = ObjProto[strToString];
50
51
 
51
52
  const _fnToString = ObjHasOwnProperty[strToString];
52
53
  // Cache what this browser reports as the object function constructor (as a string)
@@ -85,7 +86,7 @@ const rLeadingNumeric = /^(\d+[\w\d_$])/;
85
86
  }
86
87
 
87
88
  export function objToString(obj: any) {
88
- return ObjProto[strToString].call(obj);
89
+ return _objToString.call(obj);
89
90
  }
90
91
 
91
92
  export function isTypeof(value: any, theType: string): boolean {
@@ -310,21 +311,22 @@ export function strContains(value: string, search: string) {
310
311
  * Check if an object is of type Date
311
312
  */
312
313
  export function isDate(obj: any): obj is Date {
313
- return !!(obj && objToString(obj) === "[object Date]");
314
+ return !!(obj && _objToString.call(obj) === "[object Date]");
314
315
  }
315
316
 
316
317
  /**
317
318
  * Check if an object is of type Array
318
319
  */
319
- export function isArray<T = any>(obj: any): obj is Array<T> {
320
- return _isArray ? _isArray(obj) : !!(obj && objToString(obj) === "[object Array]");
320
+ export let isArray: <T = any>(obj: any) => obj is Array<T> = _isArray || _isArrayPoly;
321
+ function _isArrayPoly<T = any>(obj: any): obj is Array<T> {
322
+ return !!(obj && _objToString.call(obj) === "[object Array]");
321
323
  }
322
324
 
323
325
  /**
324
326
  * Check if an object is of type Error
325
327
  */
326
328
  export function isError(obj: any): obj is Error {
327
- return !!(obj && objToString(obj) === "[object Error]");
329
+ return !!(obj && _objToString.call(obj) === "[object Error]");
328
330
  }
329
331
 
330
332
  /**
@@ -375,24 +377,24 @@ export function isPlainObject(value: any): boolean {
375
377
  let result: boolean = false;
376
378
 
377
379
  if (value && typeof value === "object") {
378
- let proto = _getObjProto(value);
380
+ // Inlining _objGetPrototypeOf for performance to avoid an additional function call
381
+ let proto = _objGetPrototypeOf ? _objGetPrototypeOf(value) : _getObjProto(value);
379
382
  if (!proto) {
380
- // No prototype found so this is a plain Object eg. `Object.create(null)`
383
+ // No prototype found so this is a plain Object eg. 'Object.create(null)'
381
384
  result = true;
382
385
  } else {
383
- // If the prototype has a constructor then it's not a plain object
384
- if (hasOwnProperty(proto, strConstructor)) {
386
+ // Objects that have a prototype are plain only if they were created using the Object global (native) function
387
+ if (proto[strConstructor] && ObjHasOwnProperty.call(proto, strConstructor)) {
385
388
  proto = proto[strConstructor];
386
389
  }
387
390
 
388
- result = isFunction(proto) && _fnToString.call(proto) === _objFunctionString;
391
+ result = typeof proto === strShimFunction && _fnToString.call(proto) === _objFunctionString;
389
392
  }
390
393
  }
391
394
 
392
395
  return result;
393
396
  }
394
397
 
395
-
396
398
  /**
397
399
  * Convert a date to I.S.O. format in IE8
398
400
  */
@@ -598,7 +600,7 @@ export function objKeys(obj: {}): string[] {
598
600
 
599
601
  // For Performance try and use the native instance, using string lookup of the function to easily pass the ES3 build checks and minification
600
602
  if (!_objKeysHasDontEnumBug && obj[strKeys]) {
601
- return obj[strKeys];
603
+ return obj[strKeys]();
602
604
  }
603
605
 
604
606
  let result: string[] = [];
@@ -658,13 +660,12 @@ export function objDefineAccessors<T>(target: any, prop: string, getProp?: () =>
658
660
  return false;
659
661
  }
660
662
 
661
- export function objFreeze<T>(value: T): T {
662
- return _objFreeze ? _objFreeze(value) as T : value;
663
+ function _doNothing<T>(value: T): T {
664
+ return value;
663
665
  }
664
666
 
665
- export function objSeal<T>(value: T): T {
666
- return _objSeal ? _objSeal(value) as T : value;
667
- }
667
+ export const objFreeze: <T>(value: T) => T = _objFreeze || _doNothing;
668
+ export const objSeal: <T>(value: T) => T = _objSeal || _doNothing;
668
669
 
669
670
  /**
670
671
  * Return the current time via the Date now() function (if available) and falls back to (new Date()).getTime() if now() is unavailable (IE8 or less)
@@ -85,7 +85,7 @@ export declare function isDate(obj: any): obj is Date;
85
85
  /**
86
86
  * Check if an object is of type Array
87
87
  */
88
- export declare function isArray<T = any>(obj: any): obj is Array<T>;
88
+ export declare let isArray: <T = any>(obj: any) => obj is Array<T>;
89
89
  /**
90
90
  * Check if an object is of type Error
91
91
  */
@@ -186,8 +186,8 @@ export declare function objKeys(obj: {}): string[];
186
186
  * @returns True if it was able to create the accessors otherwise false
187
187
  */
188
188
  export declare function objDefineAccessors<T>(target: any, prop: string, getProp?: () => T, setProp?: (v: T) => void): boolean;
189
- export declare function objFreeze<T>(value: T): T;
190
- export declare function objSeal<T>(value: T): T;
189
+ export declare const objFreeze: <T>(value: T) => T;
190
+ export declare const objSeal: <T>(value: T) => T;
191
191
  /**
192
192
  * Return the current time via the Date now() function (if available) and falls back to (new Date()).getTime() if now() is unavailable (IE8 or less)
193
193
  * https://caniuse.com/#search=Date.now