@microsoft/applicationinsights-core-js 3.0.0-beta.2208-03 → 3.0.0-beta.2208-16

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 (121) hide show
  1. package/README.md +7 -0
  2. package/browser/applicationinsights-core-js.integrity.json +9 -9
  3. package/browser/applicationinsights-core-js.js +2040 -2155
  4. package/browser/applicationinsights-core-js.js.map +1 -1
  5. package/browser/applicationinsights-core-js.min.js +2 -2
  6. package/browser/applicationinsights-core-js.min.js.map +1 -1
  7. package/dist/applicationinsights-core-js.api.json +6998 -10817
  8. package/dist/applicationinsights-core-js.api.md +88 -177
  9. package/dist/applicationinsights-core-js.d.ts +94 -494
  10. package/dist/applicationinsights-core-js.js +2040 -2155
  11. package/dist/applicationinsights-core-js.js.map +1 -1
  12. package/dist/applicationinsights-core-js.min.js +2 -2
  13. package/dist/applicationinsights-core-js.min.js.map +1 -1
  14. package/dist/applicationinsights-core-js.rollup.d.ts +94 -494
  15. package/dist-esm/JavaScriptSDK/AppInsightsCore.js +2 -2
  16. package/dist-esm/JavaScriptSDK/AppInsightsCore.js.map +1 -1
  17. package/dist-esm/JavaScriptSDK/BaseCore.js +11 -12
  18. package/dist-esm/JavaScriptSDK/BaseCore.js.map +1 -1
  19. package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js +3 -2
  20. package/dist-esm/JavaScriptSDK/BaseTelemetryPlugin.js.map +1 -1
  21. package/dist-esm/JavaScriptSDK/ChannelController.js +2 -2
  22. package/dist-esm/JavaScriptSDK/ChannelController.js.map +1 -1
  23. package/dist-esm/JavaScriptSDK/CookieMgr.js +27 -26
  24. package/dist-esm/JavaScriptSDK/CookieMgr.js.map +1 -1
  25. package/dist-esm/JavaScriptSDK/CoreUtils.js +8 -140
  26. package/dist-esm/JavaScriptSDK/CoreUtils.js.map +1 -1
  27. package/dist-esm/JavaScriptSDK/DataCacheHelper.js +2 -2
  28. package/dist-esm/JavaScriptSDK/DataCacheHelper.js.map +1 -1
  29. package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js +3 -3
  30. package/dist-esm/JavaScriptSDK/DbgExtensionUtils.js.map +1 -1
  31. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js +4 -3
  32. package/dist-esm/JavaScriptSDK/DiagnosticLogger.js.map +1 -1
  33. package/dist-esm/JavaScriptSDK/EnvUtils.js +132 -136
  34. package/dist-esm/JavaScriptSDK/EnvUtils.js.map +1 -1
  35. package/dist-esm/JavaScriptSDK/EventHelpers.js +2 -3
  36. package/dist-esm/JavaScriptSDK/EventHelpers.js.map +1 -1
  37. package/dist-esm/JavaScriptSDK/HelperFuncs.js +23 -470
  38. package/dist-esm/JavaScriptSDK/HelperFuncs.js.map +1 -1
  39. package/dist-esm/JavaScriptSDK/InstrumentHooks.js +5 -5
  40. package/dist-esm/JavaScriptSDK/InstrumentHooks.js.map +1 -1
  41. package/dist-esm/JavaScriptSDK/InternalConstants.js +4 -4
  42. package/dist-esm/JavaScriptSDK/InternalConstants.js.map +1 -1
  43. package/dist-esm/JavaScriptSDK/NotificationManager.js +2 -2
  44. package/dist-esm/JavaScriptSDK/NotificationManager.js.map +1 -1
  45. package/dist-esm/JavaScriptSDK/PerfManager.js +4 -8
  46. package/dist-esm/JavaScriptSDK/PerfManager.js.map +1 -1
  47. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js +3 -3
  48. package/dist-esm/JavaScriptSDK/ProcessTelemetryContext.js.map +1 -1
  49. package/dist-esm/JavaScriptSDK/RandomHelper.js +1 -1
  50. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js +2 -2
  51. package/dist-esm/JavaScriptSDK/TelemetryHelpers.js.map +1 -1
  52. package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js +3 -3
  53. package/dist-esm/JavaScriptSDK/TelemetryInitializerPlugin.js.map +1 -1
  54. package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js +2 -3
  55. package/dist-esm/JavaScriptSDK/UnloadHandlerContainer.js.map +1 -1
  56. package/dist-esm/JavaScriptSDK/W3cTraceParent.js +2 -2
  57. package/dist-esm/JavaScriptSDK/W3cTraceParent.js.map +1 -1
  58. package/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js +5 -31
  59. package/dist-esm/JavaScriptSDK.Enums/EnumHelperFuncs.js.map +1 -1
  60. package/dist-esm/JavaScriptSDK.Enums/EventsDiscardedReason.js +1 -1
  61. package/dist-esm/JavaScriptSDK.Enums/LoggingEnums.js +1 -1
  62. package/dist-esm/JavaScriptSDK.Enums/SendRequestReason.js +1 -1
  63. package/dist-esm/JavaScriptSDK.Enums/TelemetryUnloadReason.js +1 -1
  64. package/dist-esm/JavaScriptSDK.Enums/TelemetryUpdateReason.js +1 -1
  65. package/dist-esm/JavaScriptSDK.Interfaces/IAppInsightsCore.js +1 -1
  66. package/dist-esm/JavaScriptSDK.Interfaces/IChannelControls.js +1 -1
  67. package/dist-esm/JavaScriptSDK.Interfaces/IConfiguration.js +1 -1
  68. package/dist-esm/JavaScriptSDK.Interfaces/ICookieMgr.js +1 -1
  69. package/dist-esm/JavaScriptSDK.Interfaces/IDbgExtension.js +1 -1
  70. package/dist-esm/JavaScriptSDK.Interfaces/IDiagnosticLogger.js +1 -1
  71. package/dist-esm/JavaScriptSDK.Interfaces/IDistributedTraceContext.js +1 -1
  72. package/dist-esm/JavaScriptSDK.Interfaces/IInstrumentHooks.js +1 -1
  73. package/dist-esm/JavaScriptSDK.Interfaces/INotificationListener.js +1 -1
  74. package/dist-esm/JavaScriptSDK.Interfaces/INotificationManager.js +1 -1
  75. package/dist-esm/JavaScriptSDK.Interfaces/IPerfEvent.js +1 -1
  76. package/dist-esm/JavaScriptSDK.Interfaces/IPerfManager.js +1 -1
  77. package/dist-esm/JavaScriptSDK.Interfaces/IProcessTelemetryContext.js +1 -1
  78. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryInitializers.js +1 -1
  79. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryItem.js +1 -1
  80. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPlugin.js +1 -1
  81. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryPluginChain.js +1 -1
  82. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUnloadState.js +1 -1
  83. package/dist-esm/JavaScriptSDK.Interfaces/ITelemetryUpdateState.js +1 -1
  84. package/dist-esm/JavaScriptSDK.Interfaces/ITraceParent.js +1 -1
  85. package/dist-esm/JavaScriptSDK.Interfaces/IUnloadableComponent.js +1 -1
  86. package/dist-esm/__DynamicConstants.js +11 -13
  87. package/dist-esm/__DynamicConstants.js.map +1 -1
  88. package/dist-esm/applicationinsights-core-js.js +6 -5
  89. package/dist-esm/applicationinsights-core-js.js.map +1 -1
  90. package/package.json +4 -3
  91. package/src/JavaScriptSDK/AppInsightsCore.ts +1 -1
  92. package/src/JavaScriptSDK/BaseCore.ts +2 -4
  93. package/src/JavaScriptSDK/BaseTelemetryPlugin.ts +2 -1
  94. package/src/JavaScriptSDK/ChannelController.ts +1 -1
  95. package/src/JavaScriptSDK/CookieMgr.ts +6 -5
  96. package/src/JavaScriptSDK/CoreUtils.ts +7 -423
  97. package/src/JavaScriptSDK/DbgExtensionUtils.ts +2 -2
  98. package/src/JavaScriptSDK/DiagnosticLogger.ts +3 -2
  99. package/src/JavaScriptSDK/EnvUtils.ts +145 -148
  100. package/src/JavaScriptSDK/EventHelpers.ts +1 -2
  101. package/src/JavaScriptSDK/HelperFuncs.ts +22 -536
  102. package/src/JavaScriptSDK/InstrumentHooks.ts +4 -4
  103. package/src/JavaScriptSDK/InternalConstants.ts +3 -3
  104. package/src/JavaScriptSDK/NotificationManager.ts +1 -1
  105. package/src/JavaScriptSDK/PerfManager.ts +3 -7
  106. package/src/JavaScriptSDK/ProcessTelemetryContext.ts +4 -4
  107. package/src/JavaScriptSDK/TelemetryHelpers.ts +1 -1
  108. package/src/JavaScriptSDK/TelemetryInitializerPlugin.ts +2 -2
  109. package/src/JavaScriptSDK/UnloadHandlerContainer.ts +1 -2
  110. package/src/JavaScriptSDK/W3cTraceParent.ts +1 -1
  111. package/src/JavaScriptSDK.Enums/EnumHelperFuncs.ts +5 -36
  112. package/src/JavaScriptSDK.Interfaces/ITelemetryPlugin.ts +7 -0
  113. package/tsconfig.json +1 -1
  114. package/types/JavaScriptSDK/CoreUtils.d.ts +0 -270
  115. package/types/JavaScriptSDK/EnvUtils.d.ts +0 -65
  116. package/types/JavaScriptSDK/HelperFuncs.d.ts +3 -154
  117. package/types/JavaScriptSDK.Enums/EnumHelperFuncs.d.ts +6 -18
  118. package/types/JavaScriptSDK.Interfaces/ITelemetryPlugin.d.ts +6 -0
  119. package/types/__DynamicConstants.d.ts +2 -4
  120. package/types/applicationinsights-core-js.d.ts +5 -4
  121. package/types/tsdoc-metadata.json +1 -1
@@ -2,13 +2,14 @@
2
2
  // Licensed under the MIT License.
3
3
  "use strict"
4
4
  import dynamicProto from "@microsoft/dynamicproto-js";
5
+ import { dumpObj, isFunction, isUndefined } from "@nevware21/ts-utils";
5
6
  import { LoggingSeverity, _InternalMessageId, _eInternalMessageId, eLoggingSeverity } from "../JavaScriptSDK.Enums/LoggingEnums";
6
7
  import { IAppInsightsCore } from "../JavaScriptSDK.Interfaces/IAppInsightsCore";
7
8
  import { IConfiguration } from "../JavaScriptSDK.Interfaces/IConfiguration";
8
9
  import { IDiagnosticLogger } from "../JavaScriptSDK.Interfaces/IDiagnosticLogger";
9
10
  import { getDebugExt } from "./DbgExtensionUtils";
10
- import { dumpObj, getConsole, getJSON, hasJSON } from "./EnvUtils";
11
- import { getCfgValue, isFunction, isUndefined } from "./HelperFuncs";
11
+ import { getConsole, getJSON, hasJSON } from "./EnvUtils";
12
+ import { getCfgValue } from "./HelperFuncs";
12
13
  import { STR_EMPTY, STR_ERROR_TO_CONSOLE, STR_WARN_TO_CONSOLE } from "./InternalConstants";
13
14
 
14
15
  /**
@@ -2,8 +2,9 @@
2
2
  // Licensed under the MIT License.
3
3
  "use strict";
4
4
 
5
- import { getGlobal, strShimObject, strShimPrototype, strShimUndefined } from "@microsoft/applicationinsights-shims";
6
- import { isString, isUndefined, strContains } from "./HelperFuncs";
5
+ import { strShimObject, strShimPrototype, strShimUndefined } from "@microsoft/applicationinsights-shims";
6
+ import { getDocument, getInst, getNavigator, hasNavigator, isString, isUndefined } from "@nevware21/ts-utils";
7
+ import { strContains } from "./HelperFuncs";
7
8
  import { STR_EMPTY } from "./InternalConstants";
8
9
 
9
10
  // TypeScript removed this interface so we need to declare the global so we can check for it's existence.
@@ -16,11 +17,7 @@ declare var XDomainRequest: any;
16
17
  * functions/properties only need to include those that are used within their own modules.
17
18
  */
18
19
 
19
- const strWindow = "window";
20
- const strDocument = "document";
21
20
  const strDocumentMode = "documentMode";
22
- const strNavigator = "navigator";
23
- const strHistory = "history";
24
21
  const strLocation = "location";
25
22
  const strConsole = "console";
26
23
  const strPerformance = "performance";
@@ -75,122 +72,122 @@ export function setEnableEnvMocks(enabled: boolean) {
75
72
  _enableMocks = enabled;
76
73
  }
77
74
 
78
- /**
79
- * Return the named global object if available, will return null if the object is not available.
80
- * @param name The globally named object
81
- */
82
- export function getGlobalInst<T>(name:string): T {
83
- let gbl = getGlobal();
84
- if (gbl && gbl[name]) {
85
- return gbl[name] as T;
86
- }
87
-
88
- // Test workaround, for environments where <global>.window (when global == window) doesn't return the base window
89
- if (name === strWindow && hasWindow()) {
90
- // tslint:disable-next-line: no-angle-bracket-type-assertion
91
- return <any>window as T;
92
- }
93
-
94
- return null;
95
- }
96
-
97
- /**
98
- * Checks if window object is available, this is required as we support the API running without a
99
- * window /document (eg. Node server, electron webworkers) and if we attempt to assign a window
100
- * object to a local variable or pass as an argument an "Uncaught ReferenceError: window is not defined"
101
- * exception will be thrown.
102
- * Defined as a function to support lazy / late binding environments.
103
- */
104
- export function hasWindow(): boolean {
105
- return Boolean(typeof window === strShimObject && window);
106
- }
107
-
108
- /**
109
- * Returns the global window object if it is present otherwise null.
110
- * This helper is used to access the window object without causing an exception
111
- * "Uncaught ReferenceError: window is not defined"
112
- */
113
- export function getWindow(): Window | null {
114
- if (hasWindow()) {
115
- return window;
116
- }
117
-
118
- // Return the global instance or null
119
- return getGlobalInst(strWindow);
120
- }
121
-
122
- /**
123
- * Checks if document object is available, this is required as we support the API running without a
124
- * window /document (eg. Node server, electron webworkers) and if we attempt to assign a document
125
- * object to a local variable or pass as an argument an "Uncaught ReferenceError: document is not defined"
126
- * exception will be thrown.
127
- * Defined as a function to support lazy / late binding environments.
128
- */
129
- export function hasDocument(): boolean {
130
- return Boolean(typeof document === strShimObject && document);
131
- }
132
-
133
- /**
134
- * Returns the global document object if it is present otherwise null.
135
- * This helper is used to access the document object without causing an exception
136
- * "Uncaught ReferenceError: document is not defined"
137
- */
138
- export function getDocument(): Document | null {
139
- if (hasDocument()) {
140
- return document;
141
- }
142
-
143
- return getGlobalInst(strDocument);
144
- }
145
-
146
-
147
- /**
148
- * Checks if navigator object is available, this is required as we support the API running without a
149
- * window /document (eg. Node server, electron webworkers) and if we attempt to assign a navigator
150
- * object to a local variable or pass as an argument an "Uncaught ReferenceError: navigator is not defined"
151
- * exception will be thrown.
152
- * Defined as a function to support lazy / late binding environments.
153
- */
154
- export function hasNavigator(): boolean {
155
- return Boolean(typeof navigator === strShimObject && navigator);
156
- }
157
-
158
- /**
159
- * Returns the global navigator object if it is present otherwise null.
160
- * This helper is used to access the navigator object without causing an exception
161
- * "Uncaught ReferenceError: navigator is not defined"
162
- */
163
- export function getNavigator(): Navigator | null {
164
- if (hasNavigator()) {
165
- return navigator;
166
- }
167
-
168
- return getGlobalInst(strNavigator);
169
- }
170
-
171
- /**
172
- * Checks if history object is available, this is required as we support the API running without a
173
- * window /document (eg. Node server, electron webworkers) and if we attempt to assign a history
174
- * object to a local variable or pass as an argument an "Uncaught ReferenceError: history is not defined"
175
- * exception will be thrown.
176
- * Defined as a function to support lazy / late binding environments.
177
- */
178
- export function hasHistory(): boolean {
179
- return Boolean(typeof history === strShimObject && history);
180
- }
181
-
182
- /**
183
- * Returns the global history object if it is present otherwise null.
184
- * This helper is used to access the history object without causing an exception
185
- * "Uncaught ReferenceError: history is not defined"
186
- */
187
- export function getHistory(): History | null {
188
- if (hasHistory()) {
189
- return history;
190
- }
191
-
192
- return getGlobalInst(strHistory);
193
- }
75
+ // /**
76
+ // * Return the named global object if available, will return null if the object is not available.
77
+ // * @param name The globally named object
78
+ // */
79
+ // export function getinst<T>(name:string): T {
80
+ // let gbl = getGlobal();
81
+ // if (gbl && gbl[name]) {
82
+ // return gbl[name] as T;
83
+ // }
84
+
85
+ // // Test workaround, for environments where <global>.window (when global == window) doesn't return the base window
86
+ // if (name === strWindow && hasWindow()) {
87
+ // // tslint:disable-next-line: no-angle-bracket-type-assertion
88
+ // return <any>window as T;
89
+ // }
90
+
91
+ // return null;
92
+ // }
93
+
94
+ // /**
95
+ // * Checks if window object is available, this is required as we support the API running without a
96
+ // * window /document (eg. Node server, electron webworkers) and if we attempt to assign a window
97
+ // * object to a local variable or pass as an argument an "Uncaught ReferenceError: window is not defined"
98
+ // * exception will be thrown.
99
+ // * Defined as a function to support lazy / late binding environments.
100
+ // */
101
+ // export const hasWindow = () => boolean = hasWindow;
102
+ // return Boolean(typeof window === strShimObject && window);
103
+ // }
104
+
105
+ // /**
106
+ // * Returns the global window object if it is present otherwise null.
107
+ // * This helper is used to access the window object without causing an exception
108
+ // * "Uncaught ReferenceError: window is not defined"
109
+ // */
110
+ // export function getWindow(): Window | null {
111
+ // if (hasWindow()) {
112
+ // return window;
113
+ // }
114
+
115
+ // // Return the global instance or null
116
+ // return getInst(strWindow);
117
+ // }
118
+
119
+ // /**
120
+ // * Checks if document object is available, this is required as we support the API running without a
121
+ // * window /document (eg. Node server, electron webworkers) and if we attempt to assign a document
122
+ // * object to a local variable or pass as an argument an "Uncaught ReferenceError: document is not defined"
123
+ // * exception will be thrown.
124
+ // * Defined as a function to support lazy / late binding environments.
125
+ // */
126
+ // export function hasDocument(): boolean {
127
+ // return Boolean(typeof document === strShimObject && document);
128
+ // }
129
+
130
+ // /**
131
+ // * Returns the global document object if it is present otherwise null.
132
+ // * This helper is used to access the document object without causing an exception
133
+ // * "Uncaught ReferenceError: document is not defined"
134
+ // */
135
+ // export function getDocument(): Document | null {
136
+ // if (hasDocument()) {
137
+ // return document;
138
+ // }
139
+
140
+ // return getInst(strDocument);
141
+ // }
142
+
143
+
144
+ // /**
145
+ // * Checks if navigator object is available, this is required as we support the API running without a
146
+ // * window /document (eg. Node server, electron webworkers) and if we attempt to assign a navigator
147
+ // * object to a local variable or pass as an argument an "Uncaught ReferenceError: navigator is not defined"
148
+ // * exception will be thrown.
149
+ // * Defined as a function to support lazy / late binding environments.
150
+ // */
151
+ // export function hasNavigator(): boolean {
152
+ // return Boolean(typeof navigator === strShimObject && navigator);
153
+ // }
154
+
155
+ // /**
156
+ // * Returns the global navigator object if it is present otherwise null.
157
+ // * This helper is used to access the navigator object without causing an exception
158
+ // * "Uncaught ReferenceError: navigator is not defined"
159
+ // */
160
+ // export function getNavigator(): Navigator | null {
161
+ // if (hasNavigator()) {
162
+ // return navigator;
163
+ // }
164
+
165
+ // return getInst(strNavigator);
166
+ // }
167
+
168
+ // /**
169
+ // * Checks if history object is available, this is required as we support the API running without a
170
+ // * window /document (eg. Node server, electron webworkers) and if we attempt to assign a history
171
+ // * object to a local variable or pass as an argument an "Uncaught ReferenceError: history is not defined"
172
+ // * exception will be thrown.
173
+ // * Defined as a function to support lazy / late binding environments.
174
+ // */
175
+ // export function hasHistory(): boolean {
176
+ // return Boolean(typeof history === strShimObject && history);
177
+ // }
178
+
179
+ // /**
180
+ // * Returns the global history object if it is present otherwise null.
181
+ // * This helper is used to access the history object without causing an exception
182
+ // * "Uncaught ReferenceError: history is not defined"
183
+ // */
184
+ // export function getHistory(): History | null {
185
+ // if (hasHistory()) {
186
+ // return history;
187
+ // }
188
+
189
+ // return getInst(strHistory);
190
+ // }
194
191
 
195
192
  /**
196
193
  * Returns the global location object if it is present otherwise null.
@@ -199,7 +196,7 @@ export function getHistory(): History | null {
199
196
  */
200
197
  export function getLocation(checkForMock?: boolean): Location | null {
201
198
  if (checkForMock && _enableMocks) {
202
- let mockLocation = getGlobalInst("__mockLocation") as Location;
199
+ let mockLocation = getInst("__mockLocation") as Location;
203
200
  if (mockLocation) {
204
201
  return mockLocation;
205
202
  }
@@ -209,7 +206,7 @@ export function getLocation(checkForMock?: boolean): Location | null {
209
206
  return location;
210
207
  }
211
208
 
212
- return getGlobalInst(strLocation);
209
+ return getInst(strLocation);
213
210
  }
214
211
 
215
212
  /**
@@ -220,7 +217,7 @@ export function getConsole(): Console | null {
220
217
  return console;
221
218
  }
222
219
 
223
- return getGlobalInst(strConsole);
220
+ return getInst(strConsole);
224
221
  }
225
222
 
226
223
  /**
@@ -229,7 +226,7 @@ export function getConsole(): Console | null {
229
226
  * global instance which could be window or globalThis for a web worker
230
227
  */
231
228
  export function getPerformance(): Performance | null {
232
- return getGlobalInst(strPerformance);
229
+ return getInst(strPerformance);
233
230
  }
234
231
 
235
232
  /**
@@ -240,7 +237,7 @@ export function getPerformance(): Performance | null {
240
237
  * Defined as a function to support lazy / late binding environments.
241
238
  */
242
239
  export function hasJSON(): boolean {
243
- return Boolean((typeof JSON === strShimObject && JSON) || getGlobalInst(strJSON) !== null);
240
+ return Boolean((typeof JSON === strShimObject && JSON) || getInst(strJSON) !== null);
244
241
  }
245
242
 
246
243
  /**
@@ -250,7 +247,7 @@ export function hasJSON(): boolean {
250
247
  */
251
248
  export function getJSON(): JSON | null {
252
249
  if (hasJSON()) {
253
- return JSON || getGlobalInst(strJSON);
250
+ return JSON || getInst(strJSON);
254
251
  }
255
252
 
256
253
  return null;
@@ -262,7 +259,7 @@ export function getJSON(): JSON | null {
262
259
  * global instance which could be window or globalThis for a web worker
263
260
  */
264
261
  export function getCrypto(): Crypto | null {
265
- return getGlobalInst(strCrypto);
262
+ return getInst(strCrypto);
266
263
  }
267
264
 
268
265
  /**
@@ -271,7 +268,7 @@ export function getCrypto(): Crypto | null {
271
268
  * global instance which could be window or globalThis for a web worker
272
269
  */
273
270
  export function getMsCrypto(): Crypto | null {
274
- return getGlobalInst(strMsCrypto);
271
+ return getInst(strMsCrypto);
275
272
  }
276
273
 
277
274
  /**
@@ -326,20 +323,20 @@ export function getIEVersion(userAgentStr: string = null): number {
326
323
  return null;
327
324
  }
328
325
 
329
- /**
330
- * Returns string representation of an object suitable for diagnostics logging.
331
- */
332
- export function dumpObj(object: any): string {
333
- const objectTypeDump: string = Object[strShimPrototype].toString.call(object);
334
- let propertyValueDump: string = STR_EMPTY;
335
- if (objectTypeDump === "[object Error]") {
336
- propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'";
337
- } else if (hasJSON()) {
338
- propertyValueDump = getJSON().stringify(object);
339
- }
340
-
341
- return objectTypeDump + propertyValueDump;
342
- }
326
+ // /**
327
+ // * Returns string representation of an object suitable for diagnostics logging.
328
+ // */
329
+ // export function dumpObj(object: any): string {
330
+ // const objectTypeDump: string = Object[strShimPrototype].toString.call(object);
331
+ // let propertyValueDump: string = STR_EMPTY;
332
+ // if (objectTypeDump === "[object Error]") {
333
+ // propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'";
334
+ // } else if (hasJSON()) {
335
+ // propertyValueDump = getJSON().stringify(object);
336
+ // }
337
+
338
+ // return objectTypeDump + propertyValueDump;
339
+ // }
343
340
 
344
341
  export function isSafari(userAgentStr ?: string) {
345
342
  if (!userAgentStr || !isString(userAgentStr)) {
@@ -371,8 +368,8 @@ export function isBeaconsSupported(): boolean {
371
368
  export function isFetchSupported(withKeepAlive?: boolean): boolean {
372
369
  let isSupported = false;
373
370
  try {
374
- isSupported = !!getGlobalInst("fetch");
375
- const request = getGlobalInst("Request");
371
+ isSupported = !!getInst("fetch");
372
+ const request = getInst("Request");
376
373
  if (isSupported && withKeepAlive && request) {
377
374
  isSupported = _hasProperty(request, "keepalive");
378
375
  }
@@ -387,7 +384,7 @@ export function useXDomainRequest(): boolean | undefined {
387
384
  if (_useXDomainRequest === null) {
388
385
  _useXDomainRequest = (typeof XDomainRequest !== strShimUndefined);
389
386
  if (_useXDomainRequest && isXhrSupported()) {
390
- _useXDomainRequest = _useXDomainRequest && !_hasProperty(getGlobalInst(strXMLHttpRequest), "withCredentials");
387
+ _useXDomainRequest = _useXDomainRequest && !_hasProperty(getInst(strXMLHttpRequest), "withCredentials");
391
388
  }
392
389
  }
393
390
 
@@ -401,7 +398,7 @@ export function useXDomainRequest(): boolean | undefined {
401
398
  export function isXhrSupported(): boolean {
402
399
  let isSupported = false;
403
400
  try {
404
- const xmlHttpRequest = getGlobalInst(strXMLHttpRequest);
401
+ const xmlHttpRequest = getInst(strXMLHttpRequest);
405
402
  isSupported = !!xmlHttpRequest;
406
403
  } catch (e) {
407
404
  // Just Swallow any failure during availability checks
@@ -1,8 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation. All rights reserved.
2
2
  // Licensed under the MIT License.
3
+ import { arrForEach, arrIndexOf, getDocument, getWindow, isArray, objForEachKey, objKeys } from "@nevware21/ts-utils";
3
4
  import { createElmNodeData, createUniqueNamespace } from "./DataCacheHelper";
4
- import { getDocument, getWindow } from "./EnvUtils";
5
- import { arrForEach, arrIndexOf, isArray, objForEachKey, objKeys } from "./HelperFuncs";
6
5
  import { STR_EMPTY } from "./InternalConstants";
7
6
 
8
7
  // Added to help with minfication