@microsoft/applicationinsights-core-js 2.7.3-nightly.2201-01 → 2.7.4-nightly.2202-01

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 (58) hide show
  1. package/browser/applicationinsights-core-js.integrity.json +9 -9
  2. package/browser/applicationinsights-core-js.js +41 -31
  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 +1 -1
  7. package/dist/applicationinsights-core-js.d.ts +1 -1
  8. package/dist/applicationinsights-core-js.js +41 -31
  9. package/dist/applicationinsights-core-js.js.map +1 -1
  10. package/dist/applicationinsights-core-js.min.js +2 -2
  11. package/dist/applicationinsights-core-js.min.js.map +1 -1
  12. package/dist/applicationinsights-core-js.rollup.d.ts +1 -1
  13. package/dist-esm/JavaScriptSDK/AppInsightsCore.js +1 -1
  14. package/dist-esm/JavaScriptSDK/BaseCore.js +1 -1
  15. package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +1 -1
  16. package/dist-esm/JavaScriptSDK/ChannelController.js +1 -1
  17. package/dist-esm/JavaScriptSDK/Constants.js +1 -1
  18. package/dist-esm/JavaScriptSDK/CookieMgr.js +1 -1
  19. package/dist-esm/JavaScriptSDK/CoreUtils.js +1 -1
  20. package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
  21. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +1 -1
  22. package/dist-esm/JavaScriptSDK/EnvUtils.js +2 -2
  23. package/dist-esm/JavaScriptSDK/EnvUtils.js.map +1 -1
  24. package/dist-esm/JavaScriptSDK/HelperFuncs.js +24 -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 +2 -2
  53. package/src/JavaScriptSDK/CookieMgr.ts +1 -1
  54. package/src/JavaScriptSDK/EnvUtils.ts +1 -1
  55. package/src/JavaScriptSDK/HelperFuncs.ts +23 -15
  56. package/src/JavaScriptSDK/PerfManager.ts +2 -2
  57. package/src/JavaScriptSDK/ProcessTelemetryContext.ts +1 -1
  58. package/types/tsdoc-metadata.json +1 -1
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.3-nightly.2201-01",
4
+ "version": "2.7.4-nightly.2202-01",
5
5
  "description": "Microsoft Application Insights Core Javascript SDK",
6
6
  "homepage": "https://github.com/microsoft/ApplicationInsights-JS#readme",
7
7
  "keywords": [
@@ -61,7 +61,7 @@
61
61
  "tslib": "*"
62
62
  },
63
63
  "dependencies": {
64
- "@microsoft/applicationinsights-shims": "2.0.0",
64
+ "@microsoft/applicationinsights-shims": "2.0.1",
65
65
  "@microsoft/dynamicproto-js": "^1.1.4"
66
66
  },
67
67
  "publishConfig": {
@@ -140,7 +140,7 @@ export function createCookieMgr(rootConfig?: IConfiguration, logger?: IDiagnosti
140
140
  if (_isMgrEnabled(cookieMgr)) {
141
141
  let values: any = {};
142
142
  let theValue = strTrim(value || strEmpty);
143
- let idx = theValue.indexOf(";")
143
+ let idx = theValue.indexOf(";");
144
144
  if (idx !== -1) {
145
145
  theValue = strTrim(value.substring(0, idx));
146
146
  values = _extractParts(value.substring(idx + 1));
@@ -386,7 +386,7 @@ export function isFetchSupported(withKeepAlive?: boolean): boolean {
386
386
 
387
387
  export function useXDomainRequest(): boolean | undefined {
388
388
  if (_useXDomainRequest === null) {
389
- _useXDomainRequest = (typeof XDomainRequest !== undefined);
389
+ _useXDomainRequest = (typeof XDomainRequest !== "undefined");
390
390
  if (_useXDomainRequest && isXhrSupported()) {
391
391
  _useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst("XMLHttpRequest"), "withCredentials");
392
392
  }
@@ -13,6 +13,7 @@ const strAttachEvent = "attachEvent";
13
13
  const strAddEventHelper = "addEventListener";
14
14
  const strDetachEvent = "detachEvent";
15
15
  const strRemoveEventListener = "removeEventListener";
16
+ const strToISOString = "toISOString";
16
17
 
17
18
  const _objDefineProperty = ObjDefineProperty;
18
19
  const _objFreeze = ObjClass["freeze"];
@@ -271,24 +272,31 @@ export function isSymbol(value: any): boolean {
271
272
  * Convert a date to I.S.O. format in IE8
272
273
  */
273
274
  export function toISOString(date: Date) {
274
- if (isDate(date)) {
275
- const pad = (num: number) => {
276
- let r = String(num);
277
- if (r.length === 1) {
278
- r = "0" + r;
275
+ if (date) {
276
+ if (date[strToISOString]) {
277
+ // For Performance try and use the native instance, using string lookup of the function to easily pass the ES3 build checks and minification
278
+ return date[strToISOString]();
279
+ }
280
+
281
+ if (isDate(date)) {
282
+ const pad = (num: number) => {
283
+ let r = String(num);
284
+ if (r.length === 1) {
285
+ r = "0" + r;
286
+ }
287
+
288
+ return r;
279
289
  }
280
290
 
281
- return r;
291
+ return date.getUTCFullYear()
292
+ + "-" + pad(date.getUTCMonth() + 1)
293
+ + "-" + pad(date.getUTCDate())
294
+ + "T" + pad(date.getUTCHours())
295
+ + ":" + pad(date.getUTCMinutes())
296
+ + ":" + pad(date.getUTCSeconds())
297
+ + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5)
298
+ + "Z";
282
299
  }
283
-
284
- return date.getUTCFullYear()
285
- + "-" + pad(date.getUTCMonth() + 1)
286
- + "-" + pad(date.getUTCDate())
287
- + "T" + pad(date.getUTCHours())
288
- + ":" + pad(date.getUTCMinutes())
289
- + ":" + pad(date.getUTCSeconds())
290
- + "." + String((date.getUTCMilliseconds() / 1000).toFixed(3)).slice(2, 5)
291
- + "Z";
292
300
  }
293
301
  }
294
302
 
@@ -135,7 +135,7 @@ export class PerfEvent implements IPerfEvent {
135
135
  // If we couldn't define the property set during complete -- to minimize the perf impact until after the time
136
136
  _self.payload = payloadDetails();
137
137
  }
138
- }
138
+ };
139
139
  }
140
140
  }
141
141
 
@@ -232,7 +232,7 @@ export function doPerf<T>(mgrSource: IPerfManagerProvider | IPerfManager, getSou
232
232
  let perfMgr: IPerfManager = mgrSource as IPerfManager;
233
233
  if (isFunction(perfMgr["getPerfMgr"])) {
234
234
  // Looks like a perf manager provider object
235
- perfMgr = perfMgr["getPerfMgr"]()
235
+ perfMgr = perfMgr["getPerfMgr"]();
236
236
  }
237
237
 
238
238
  if (perfMgr) {
@@ -9,7 +9,7 @@ import { ITelemetryItem } from "../JavaScriptSDK.Interfaces/ITelemetryItem";
9
9
  import { IPlugin, ITelemetryPlugin } from "../JavaScriptSDK.Interfaces/ITelemetryPlugin";
10
10
  import { IProcessTelemetryContext } from "../JavaScriptSDK.Interfaces/IProcessTelemetryContext";
11
11
  import { ITelemetryPluginChain } from "../JavaScriptSDK.Interfaces/ITelemetryPluginChain";
12
- import { DiagnosticLogger, safeGetLogger } from "./DiagnosticLogger";
12
+ import { safeGetLogger } from "./DiagnosticLogger";
13
13
  import { TelemetryPluginChain } from "./TelemetryPluginChain";
14
14
  import { arrForEach, isFunction, isNullOrUndefined, isUndefined } from "./HelperFuncs";
15
15
 
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.18.21"
8
+ "packageVersion": "7.19.4"
9
9
  }
10
10
  ]
11
11
  }