@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.
- package/browser/applicationinsights-core-js.integrity.json +9 -9
- package/browser/applicationinsights-core-js.js +12 -14
- package/browser/applicationinsights-core-js.js.map +1 -1
- package/browser/applicationinsights-core-js.min.js +2 -2
- package/browser/applicationinsights-core-js.min.js.map +1 -1
- package/dist/applicationinsights-core-js.api.json +27 -136
- package/dist/applicationinsights-core-js.api.md +3 -3
- package/dist/applicationinsights-core-js.d.ts +4 -4
- package/dist/applicationinsights-core-js.js +12 -14
- package/dist/applicationinsights-core-js.js.map +1 -1
- package/dist/applicationinsights-core-js.min.js +2 -2
- package/dist/applicationinsights-core-js.min.js.map +1 -1
- package/dist/applicationinsights-core-js.rollup.d.ts +4 -4
- package/dist-esm/JavaScriptSDK/AppInsightsCore.js +1 -1
- package/dist-esm/JavaScriptSDK/BaseCore.js +1 -1
- package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +1 -1
- package/dist-esm/JavaScriptSDK/ChannelController.js +1 -1
- package/dist-esm/JavaScriptSDK/Constants.js +1 -1
- package/dist-esm/JavaScriptSDK/CookieMgr.js +1 -1
- package/dist-esm/JavaScriptSDK/CoreUtils.js +1 -1
- package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +1 -1
- package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +1 -1
- package/dist-esm/JavaScriptSDK/EnvUtils.js +1 -1
- package/dist-esm/JavaScriptSDK/HelperFuncs.js +19 -17
- package/dist-esm/JavaScriptSDK/HelperFuncs.js.map +1 -1
- package/dist-esm/JavaScriptSDK/InstrumentHooks.js +1 -1
- package/dist-esm/JavaScriptSDK/NotificationManager.js +1 -1
- package/dist-esm/JavaScriptSDK/PerfManager.js +1 -1
- package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +1 -1
- package/dist-esm/JavaScriptSDK/RandomHelper.js +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +1 -1
- package/dist-esm/JavaScriptSDK/TelemetryPluginChain.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +1 -1
- package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
- package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -1
- package/dist-esm/applicationinsights-core-js.js +1 -1
- package/package.json +1 -1
- package/src/JavaScriptSDK/HelperFuncs.ts +18 -17
- 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-
|
|
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-
|
|
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
|
|
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 &&
|
|
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
|
|
320
|
-
|
|
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 &&
|
|
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
|
-
|
|
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.
|
|
383
|
+
// No prototype found so this is a plain Object eg. 'Object.create(null)'
|
|
381
384
|
result = true;
|
|
382
385
|
} else {
|
|
383
|
-
//
|
|
384
|
-
if (
|
|
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 =
|
|
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
|
-
|
|
662
|
-
return
|
|
663
|
+
function _doNothing<T>(value: T): T {
|
|
664
|
+
return value;
|
|
663
665
|
}
|
|
664
666
|
|
|
665
|
-
export
|
|
666
|
-
|
|
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
|
|
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
|
|
190
|
-
export declare
|
|
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
|