@microsoft/applicationinsights-shims
Advanced tools
Comparing version 1.0.3 to 2.0.0
/*! | ||
* Application Insights JavaScript SDK - Shim functions, 1.0.3 | ||
* Microsoft Application Insights JavaScript SDK - Shim functions, 2.0.0 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -8,3 +8,3 @@ */ | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(factory((global.Microsoft = global.Microsoft || {}, global.Microsoft.ApplicationInsights = global.Microsoft.ApplicationInsights || {}, global.Microsoft.ApplicationInsights.Shims = {}))); | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.Microsoft = global.Microsoft || {}, global.Microsoft.ApplicationInsights = global.Microsoft.ApplicationInsights || {}, global.Microsoft.ApplicationInsights.Shims = {}))); | ||
}(this, (function (exports) { 'use strict'; | ||
@@ -17,2 +17,10 @@ | ||
var strShimHasOwnProperty = "hasOwnProperty"; | ||
var strDefault = "default"; | ||
var ObjClass = Object; | ||
var ObjProto = ObjClass[strShimPrototype]; | ||
var ObjAssign = ObjClass["assign"]; | ||
var ObjCreate = ObjClass["create"]; | ||
var ObjDefineProperty = ObjClass["defineProperty"]; | ||
var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty]; | ||
/** | ||
@@ -45,2 +53,5 @@ * Returns the current global scope object, for a normal web page this will be the current | ||
} | ||
function throwTypeError(message) { | ||
throw new TypeError(message); | ||
} | ||
/** | ||
@@ -53,3 +64,3 @@ * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil | ||
function objCreateFn(obj) { | ||
var func = Object["create"]; | ||
var func = ObjCreate; | ||
// Use build in Object.create | ||
@@ -65,3 +76,3 @@ if (func) { | ||
if (type !== strShimObject && type !== strShimFunction) { | ||
throw new TypeError('Object prototype may only be an Object:' + obj); | ||
throwTypeError('Object prototype may only be an Object:' + obj); | ||
} | ||
@@ -72,7 +83,21 @@ function tmpFunc() { } | ||
} | ||
function __assignFn(t) { | ||
// Most of these functions have been directly shamelessly "lifted" from the https://github.com/@microsoft/tslib and | ||
// modified to be ES3 compatible and applying several minification and tree-shaking techniques so that Application Insights | ||
// can successfully use TypeScript "importHelpers" which imports tslib during compilation but it will use these at runtime | ||
// Which is also why all of the functions have not been included as Application Insights currently doesn't use or require | ||
// them. | ||
var SymbolObj = (getGlobal() || {})["Symbol"]; | ||
var ReflectObj = (getGlobal() || {})["Reflect"]; | ||
var __hasReflect = !!ReflectObj; | ||
var strDecorate = "decorate"; | ||
var strMetadata = "metadata"; | ||
var strGetOwnPropertySymbols = "getOwnPropertySymbols"; | ||
var strIterator = "iterator"; | ||
var __objAssignFnImpl = function (t) { | ||
// tslint:disable-next-line: ban-comma-operator | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) { | ||
if (Object[strShimPrototype][strShimHasOwnProperty].call(s, p)) { | ||
if (ObjProto[strShimHasOwnProperty].call(s, p)) { | ||
t[p] = s[p]; | ||
@@ -83,6 +108,7 @@ } | ||
return t; | ||
} | ||
}; | ||
var __assignFn = ObjAssign || __objAssignFnImpl; | ||
// tslint:disable-next-line: only-arrow-functions | ||
var __extendStaticsFn = function (d, b) { | ||
__extendStaticsFn = Object["setPrototypeOf"] || | ||
var extendStaticsFn = function (d, b) { | ||
extendStaticsFn = ObjClass["setPrototypeOf"] || | ||
// tslint:disable-next-line: only-arrow-functions | ||
@@ -98,6 +124,9 @@ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
}; | ||
return __extendStaticsFn(d, b); | ||
return extendStaticsFn(d, b); | ||
}; | ||
function __extendsFn(d, b) { | ||
__extendStaticsFn(d, b); | ||
if (typeof b !== strShimFunction && b !== null) { | ||
throwTypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
} | ||
extendStaticsFn(d, b); | ||
function __() { this.constructor = d; } | ||
@@ -107,31 +136,230 @@ // tslint:disable-next-line: ban-comma-operator | ||
} | ||
var globalObj = getGlobal() || {}; | ||
// tslint:disable: only-arrow-functions | ||
(function (root, assignFn, extendsFn) { | ||
// Assign the globally scoped versions of the functions -- used when consuming individual ts files | ||
// If check is to support NativeScript where these are marked as readonly | ||
if (!root.__assign) { | ||
root.__assign = Object.assign || assignFn; | ||
function __restFn(s, e) { | ||
var t = {}; | ||
for (var k in s) { | ||
if (ObjHasOwnProperty.call(s, k) && e.indexOf(k) < 0) { | ||
t[k] = s[k]; | ||
} | ||
} | ||
if (!root.__extends) { | ||
root.__extends = extendsFn; | ||
if (s != null && typeof ObjClass[strGetOwnPropertySymbols] === strShimFunction) { | ||
for (var i = 0, p = ObjClass[strGetOwnPropertySymbols](s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && ObjProto["propertyIsEnumerable"].call(s, p[i])) { | ||
t[p[i]] = s[p[i]]; | ||
} | ||
} | ||
} | ||
})(globalObj, __assignFn, __extendsFn); | ||
// Assign local variables that will be used for embedded scenarios, if check is to support NativeScript where these are marked as readonly | ||
if (!__assign) { | ||
__assign = globalObj.__assign; | ||
return t; | ||
} | ||
if (!__extends) { | ||
__extends = globalObj.__extends; | ||
function __decorateFn(decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = ObjClass["getOwnPropertyDescriptor"](target, key) : desc, d; | ||
if (__hasReflect && typeof ReflectObj[strDecorate] === strShimFunction) { | ||
r = ReflectObj[strDecorate](decorators, target, key, desc); | ||
} | ||
else { | ||
for (var i = decorators.length - 1; i >= 0; i--) { | ||
// tslint:disable-next-line:no-conditional-assignment | ||
if (d = decorators[i]) { | ||
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
} | ||
} | ||
} | ||
// tslint:disable-next-line:ban-comma-operator | ||
return c > 3 && r && ObjDefineProperty(target, key, r), r; | ||
} | ||
function __paramFn(paramIndex, decorator) { | ||
return function (target, key) { | ||
decorator(target, key, paramIndex); | ||
}; | ||
} | ||
function __metadataFn(metadataKey, metadataValue) { | ||
if (__hasReflect && ReflectObj[strMetadata] === strShimFunction) { | ||
return ReflectObj[strMetadata](metadataKey, metadataValue); | ||
} | ||
} | ||
function __exportStarFn(m, o) { | ||
for (var p in m) { | ||
if (p !== strDefault && !ObjHasOwnProperty.call(o, p)) { | ||
__createBindingFn(o, m, p); | ||
} | ||
} | ||
} | ||
function __createBindingFn(o, m, k, k2) { | ||
if (k2 === undefined) { | ||
k2 = k; | ||
} | ||
if (ObjCreate) { | ||
ObjDefineProperty(o, k2, { | ||
enumerable: true, | ||
get: function () { | ||
return m[k]; | ||
} | ||
}); | ||
} | ||
else { | ||
o[k2] = m[k]; | ||
} | ||
} | ||
function __valuesFn(o) { | ||
var s = typeof SymbolObj === strShimFunction && SymbolObj[strIterator], m = s && o[s], i = 0; | ||
if (m) { | ||
return m.call(o); | ||
} | ||
if (o && typeof o.length === "number") { | ||
return { | ||
next: function () { | ||
if (o && i >= o.length) { | ||
o = void 0; | ||
} | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
} | ||
throwTypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
} | ||
function __readFn(o, n) { | ||
var m = typeof SymbolObj === strShimFunction && o[SymbolObj[strIterator]]; | ||
if (!m) { | ||
return o; | ||
} | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) { | ||
ar.push(r.value); | ||
} | ||
} | ||
catch (error) { | ||
e = { | ||
error: error | ||
}; | ||
} | ||
finally { | ||
try { | ||
// tslint:disable-next-line:no-conditional-assignment | ||
if (r && !r.done && (m = i["return"])) { | ||
m.call(i); | ||
} | ||
} | ||
finally { | ||
if (e) { | ||
// tslint:disable-next-line:no-unsafe-finally | ||
throw e.error; | ||
} | ||
} | ||
} | ||
return ar; | ||
} | ||
/** @deprecated */ | ||
function __spreadArraysFn() { | ||
var theArgs = arguments; | ||
// Calculate new total size | ||
for (var s = 0, i = 0, il = theArgs.length; i < il; i++) { | ||
s += theArgs[i].length; | ||
} | ||
// Create new full array | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) { | ||
for (var a = theArgs[i], j = 0, jl = a.length; j < jl; j++, k++) { | ||
r[k] = a[j]; | ||
} | ||
} | ||
return r; | ||
} | ||
function __spreadArrayFn(to, from) { | ||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) { | ||
to[j] = from[i]; | ||
} | ||
return to; | ||
} | ||
function __makeTemplateObjectFn(cooked, raw) { | ||
if (ObjDefineProperty) { | ||
ObjDefineProperty(cooked, "raw", { value: raw }); | ||
} | ||
else { | ||
cooked.raw = raw; | ||
} | ||
return cooked; | ||
} | ||
function __importStarFn(mod) { | ||
if (mod && mod.__esModule) { | ||
return mod; | ||
} | ||
var result = {}; | ||
if (mod != null) { | ||
for (var k in mod) { | ||
if (k !== strDefault && Object.prototype.hasOwnProperty.call(mod, k)) { | ||
__createBindingFn(result, mod, k); | ||
} | ||
} | ||
} | ||
// Set default module | ||
if (ObjCreate) { | ||
ObjDefineProperty(result, strDefault, { enumerable: true, value: mod }); | ||
} | ||
else { | ||
result[strDefault] = mod; | ||
} | ||
return result; | ||
} | ||
function __importDefaultFn(mod) { | ||
return (mod && mod.__esModule) ? mod : { strDefault: mod }; | ||
} | ||
function __exposeGlobalTsLib() { | ||
var globalObj = getGlobal() || {}; | ||
// tslint:disable: only-arrow-functions | ||
(function (root, assignFn, extendsFn, createBindingFn) { | ||
// Assign the globally scoped versions of the functions -- used when consuming individual ts files | ||
// If check is to support NativeScript where these are marked as readonly | ||
if (!root.__assign) { | ||
root.__assign = ObjAssign || assignFn; | ||
} | ||
if (!root.__extends) { | ||
root.__extends = extendsFn; | ||
} | ||
if (!root.__createBinding) { | ||
root.__createBinding = createBindingFn; | ||
} | ||
})(globalObj, __assignFn, __extendsFn, __createBindingFn); | ||
// Assign local variables that will be used for embedded scenarios, if check is to support NativeScript where these are marked as readonly | ||
if (!__assign) { | ||
__assign = globalObj.__assign; | ||
} | ||
if (!__extends) { | ||
__extends = globalObj.__extends; | ||
} | ||
if (!__createBinding) { | ||
__createBinding = globalObj.__createBinding; | ||
} | ||
} | ||
exports.ObjAssign = ObjAssign; | ||
exports.ObjClass = ObjClass; | ||
exports.ObjCreate = ObjCreate; | ||
exports.ObjDefineProperty = ObjDefineProperty; | ||
exports.ObjHasOwnProperty = ObjHasOwnProperty; | ||
exports.ObjProto = ObjProto; | ||
exports.__assignFn = __assignFn; | ||
exports.__createBindingFn = __createBindingFn; | ||
exports.__decorateFn = __decorateFn; | ||
exports.__exportStarFn = __exportStarFn; | ||
exports.__exposeGlobalTsLib = __exposeGlobalTsLib; | ||
exports.__extendsFn = __extendsFn; | ||
exports.__importDefaultFn = __importDefaultFn; | ||
exports.__importStarFn = __importStarFn; | ||
exports.__makeTemplateObjectFn = __makeTemplateObjectFn; | ||
exports.__metadataFn = __metadataFn; | ||
exports.__paramFn = __paramFn; | ||
exports.__readFn = __readFn; | ||
exports.__restFn = __restFn; | ||
exports.__spreadArrayFn = __spreadArrayFn; | ||
exports.__spreadArraysFn = __spreadArraysFn; | ||
exports.__valuesFn = __valuesFn; | ||
exports.getGlobal = getGlobal; | ||
exports.objCreateFn = objCreateFn; | ||
exports.strDefault = strDefault; | ||
exports.strShimFunction = strShimFunction; | ||
exports.strShimHasOwnProperty = strShimHasOwnProperty; | ||
exports.strShimObject = strShimObject; | ||
exports.strShimPrototype = strShimPrototype; | ||
exports.strShimUndefined = strShimUndefined; | ||
exports.strShimPrototype = strShimPrototype; | ||
exports.strShimHasOwnProperty = strShimHasOwnProperty; | ||
exports.getGlobal = getGlobal; | ||
exports.objCreateFn = objCreateFn; | ||
exports.__assignFn = __assignFn; | ||
exports.__extendsFn = __extendsFn; | ||
exports.throwTypeError = throwTypeError; | ||
@@ -138,0 +366,0 @@ (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true }); |
/*! | ||
* Application Insights JavaScript SDK - Shim functions, 1.0.3 | ||
* Microsoft Application Insights JavaScript SDK - Shim functions, 2.0.0 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
*/ | ||
var t=this,n=function(t){"use strict";var i="function",r="object",n="undefined",s="prototype",f="hasOwnProperty";function e(){return typeof globalThis!=n&&globalThis?globalThis:typeof self!=n&&self?self:typeof window!=n&&window?window:typeof global!=n&&global?global:null}function o(t){var n=Object.create;if(n)return n(t);if(null==t)return{};var e=typeof t;if(e!==r&&e!==i)throw new TypeError("Object prototype may only be an Object:"+t);function o(){}return o[s]=t,new o}function a(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var i in n=arguments[e])Object[s][f].call(n,i)&&(t[i]=n[i]);return t}var c=function(t,n){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n[f](e)&&(t[e]=n[e])})(t,n)};function l(t,n){function e(){this.constructor=t}c(t,n),t[s]=null===n?o(n):(e[s]=n[s],new e)}var u,_=e()||{},p=l;(u=_).__assign||(u.__assign=Object.assign||a),u.__extends||(u.__extends=p),__assign=__assign||_.__assign,__extends=__extends||_.__extends,t.strShimFunction=i,t.strShimObject=r,t.strShimUndefined=n,t.strShimPrototype=s,t.strShimHasOwnProperty=f,t.getGlobal=e,t.objCreateFn=o,t.__assignFn=a,t.__extendsFn=l,function(t,n,e){var o=Object.defineProperty;if(o)try{return o(t,n,e)}catch(i){}typeof e.value!==undefined&&(t[n]=e.value)}(t,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t.Microsoft=t.Microsoft||{},t.Microsoft.ApplicationInsights=t.Microsoft.ApplicationInsights||{},t.Microsoft.ApplicationInsights.Shims={})); | ||
var e=this,n=function(e){"use strict";var f="function",r="object",n="undefined",o="prototype",i="hasOwnProperty",a="default",u=Object,l=u[o],s=u.assign,c=u.create,_=u.defineProperty,p=l[i];function d(){return typeof globalThis!=n&&globalThis?globalThis:typeof self!=n&&self?self:typeof window!=n&&window?window:typeof global!=n&&global?global:null}function y(e){throw new TypeError(e)}function g(e){if(c)return c(e);if(null==e)return{};var n=typeof e;function t(){}return n!==r&&n!==f&&y("Object prototype may only be an Object:"+e),t[o]=e,new t}var b=(d()||{}).Symbol,h=(d()||{}).Reflect,v=!!h,m="decorate",t="metadata",O="getOwnPropertySymbols",w="iterator",j=s||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])l[i].call(n,o)&&(e[o]=n[o]);return e},F=function(e,n){return(F=u.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[i](t)&&(e[t]=n[t])})(e,n)};function x(e,n){function t(){this.constructor=e}typeof n!==f&&null!==n&&y("Class extends value "+n+" is not a constructor or null"),F(e,n),e[o]=null===n?g(n):(t[o]=n[o],new t)}function P(e,n,t,r){r===undefined&&(r=t),c?_(e,r,{enumerable:!0,get:function(){return n[t]}}):e[r]=n[t]}e.ObjAssign=s,e.ObjClass=u,e.ObjCreate=c,e.ObjDefineProperty=_,e.ObjHasOwnProperty=p,e.ObjProto=l,e.__assignFn=j,e.__createBindingFn=P,e.__decorateFn=function(e,n,t,r){var o,i=arguments.length,a=i<3?n:null===r?r=u.getOwnPropertyDescriptor(n,t):r;if(v&&typeof h[m]===f)a=h[m](e,n,t,r);else for(var l=e.length-1;0<=l;l--)(o=e[l])&&(a=(i<3?o(a):3<i?o(n,t,a):o(n,t))||a);return 3<i&&a&&_(n,t,a),a},e.__exportStarFn=function(e,n){for(var t in e)t===a||p.call(n,t)||P(n,e,t)},e.__exposeGlobalTsLib=function(){var e,n=d()||{},t=x,r=P;(e=n).__assign||(e.__assign=s||j),e.__extends||(e.__extends=t),e.__createBinding||(e.__createBinding=r),__assign=__assign||n.__assign,__extends=__extends||n.__extends,__createBinding=__createBinding||n.__createBinding},e.__extendsFn=x,e.__importDefaultFn=function(e){return e&&e.__esModule?e:{strDefault:e}},e.__importStarFn=function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var t in e)t!==a&&Object.prototype.hasOwnProperty.call(e,t)&&P(n,e,t);return c?_(n,a,{enumerable:!0,value:e}):n[a]=e,n},e.__makeTemplateObjectFn=function(e,n){return _?_(e,"raw",{value:n}):e.raw=n,e},e.__metadataFn=function(e,n){if(v&&h[t]===f)return h[t](e,n)},e.__paramFn=function(t,r){return function(e,n){r(e,n,t)}},e.__readFn=function(e,n){var t=typeof b===f&&e[b[w]];if(!t)return e;var r,o,i=t.call(e),a=[];try{for(;(void 0===n||0<n--)&&!(r=i.next()).done;)a.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(t=i["return"])&&t.call(i)}finally{if(o)throw o.error}}return a},e.__restFn=function(e,n){var t,r={};for(t in e)p.call(e,t)&&!~n.indexOf(t)&&(r[t]=e[t]);if(null!=e&&typeof u[O]===f)for(var o=0,i=u[O](e);o<i.length;o++)!~n.indexOf(i[o])&&l.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]]);return r},e.__spreadArrayFn=function(e,n){for(var t=0,r=n.length,o=e.length;t<r;t++,o++)e[o]=n[t];return e},e.__spreadArraysFn=function(){for(var e=arguments,n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(var o=Array(n),i=0,t=0;t<r;t++)for(var a=e[t],l=0,f=a.length;l<f;l++,i++)o[i]=a[l];return o},e.__valuesFn=function(e){var n=typeof b===f&&b[w],t=n&&e[n],r=0;return t?t.call(e):e&&"number"==typeof e.length?{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}}:void y(n?"Object is not iterable.":"Symbol.iterator is not defined.")},e.getGlobal=d,e.objCreateFn=g,e.strDefault=a,e.strShimFunction=f,e.strShimHasOwnProperty=i,e.strShimObject=r,e.strShimPrototype=o,e.strShimUndefined=n,e.throwTypeError=y,function(e,n,t){var r=Object.defineProperty;if(r)try{return r(e,n,t)}catch(o){}typeof t.value!==undefined&&(e[n]=t.value)}(e,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self).Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights=e.Microsoft.ApplicationInsights||{},e.Microsoft.ApplicationInsights.Shims={})); |
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
export var strShimFunction = "function"; | ||
export var strShimObject = "object"; | ||
export var strShimUndefined = "undefined"; | ||
export var strShimPrototype = "prototype"; | ||
export var strShimHasOwnProperty = "hasOwnProperty"; | ||
/** | ||
* Returns the current global scope object, for a normal web page this will be the current | ||
* window, for a Web Worker this will be current worker global scope via "self". The internal | ||
* implementation returns the first available instance object in the following order | ||
* - globalThis (New standard) | ||
* - self (Will return the current window instance for supported browsers) | ||
* - window (fallback for older browser implementations) | ||
* - global (NodeJS standard) | ||
* - <null> (When all else fails) | ||
* While the return type is a Window for the normal case, not all environments will support all | ||
* of the properties or functions. | ||
*/ | ||
export function getGlobal() { | ||
if (typeof globalThis !== strShimUndefined && globalThis) { | ||
return globalThis; | ||
} | ||
if (typeof self !== strShimUndefined && self) { | ||
return self; | ||
} | ||
if (typeof window !== strShimUndefined && window) { | ||
return window; | ||
} | ||
if (typeof global !== strShimUndefined && global) { | ||
return global; | ||
} | ||
return null; | ||
} | ||
/** | ||
* Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil | ||
* for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation. | ||
* Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations | ||
* @param obj Object to use as a prototype. May be null | ||
*/ | ||
export function objCreateFn(obj) { | ||
var func = Object["create"]; | ||
// Use build in Object.create | ||
if (func) { | ||
// Use Object create method if it exists | ||
return func(obj); | ||
} | ||
if (obj == null) { | ||
return {}; | ||
} | ||
var type = typeof obj; | ||
if (type !== strShimObject && type !== strShimFunction) { | ||
throw new TypeError('Object prototype may only be an Object:' + obj); | ||
} | ||
function tmpFunc() { } | ||
tmpFunc[strShimPrototype] = obj; | ||
return new tmpFunc(); | ||
} | ||
export function __assignFn(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) { | ||
if (Object[strShimPrototype][strShimHasOwnProperty].call(s, p)) { | ||
t[p] = s[p]; | ||
} | ||
} | ||
} | ||
return t; | ||
} | ||
// tslint:disable-next-line: only-arrow-functions | ||
var __extendStaticsFn = function (d, b) { | ||
__extendStaticsFn = Object["setPrototypeOf"] || | ||
// tslint:disable-next-line: only-arrow-functions | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
// tslint:disable-next-line: only-arrow-functions | ||
function (d, b) { | ||
for (var p in b) { | ||
if (b[strShimHasOwnProperty](p)) { | ||
d[p] = b[p]; | ||
} | ||
} | ||
}; | ||
return __extendStaticsFn(d, b); | ||
}; | ||
export function __extendsFn(d, b) { | ||
__extendStaticsFn(d, b); | ||
function __() { this.constructor = d; } | ||
// tslint:disable-next-line: ban-comma-operator | ||
d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __()); | ||
} | ||
var globalObj = getGlobal() || {}; | ||
// tslint:disable: only-arrow-functions | ||
(function (root, assignFn, extendsFn) { | ||
// Assign the globally scoped versions of the functions -- used when consuming individual ts files | ||
// If check is to support NativeScript where these are marked as readonly | ||
if (!root.__assign) { | ||
root.__assign = Object.assign || assignFn; | ||
} | ||
if (!root.__extends) { | ||
root.__extends = extendsFn; | ||
} | ||
})(globalObj, __assignFn, __extendsFn); | ||
// Assign local variables that will be used for embedded scenarios, if check is to support NativeScript where these are marked as readonly | ||
if (!__assign) { | ||
__assign = globalObj.__assign; | ||
} | ||
if (!__extends) { | ||
__extends = globalObj.__extends; | ||
} | ||
export { strShimFunction, strShimObject, strShimUndefined, strShimPrototype, strShimHasOwnProperty, strDefault, ObjClass, ObjProto, ObjAssign, ObjCreate, ObjDefineProperty, ObjHasOwnProperty } from "./Constants"; | ||
export { throwTypeError, objCreateFn, getGlobal } from "./Helpers"; | ||
export { __assignFn, __extendsFn, __restFn, __spreadArrayFn, __spreadArraysFn, __decorateFn, __paramFn, __metadataFn, __createBindingFn, __valuesFn, __readFn, __makeTemplateObjectFn, __importDefaultFn, __importStarFn, __exportStarFn, } from "./TsLibShims"; | ||
export { __exposeGlobalTsLib } from "./TsLibGlobals"; | ||
//# sourceMappingURL=applicationinsights-shims.js.map |
/*! | ||
* Application Insights JavaScript SDK - Shim functions, 1.0.3 | ||
* Microsoft Application Insights JavaScript SDK - Shim functions, 2.0.0 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -10,2 +10,10 @@ */ | ||
var strShimHasOwnProperty = "hasOwnProperty"; | ||
var strDefault = "default"; | ||
var ObjClass = Object; | ||
var ObjProto = ObjClass[strShimPrototype]; | ||
var ObjAssign = ObjClass["assign"]; | ||
var ObjCreate = ObjClass["create"]; | ||
var ObjDefineProperty = ObjClass["defineProperty"]; | ||
var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty]; | ||
/** | ||
@@ -38,2 +46,5 @@ * Returns the current global scope object, for a normal web page this will be the current | ||
} | ||
function throwTypeError(message) { | ||
throw new TypeError(message); | ||
} | ||
/** | ||
@@ -46,3 +57,3 @@ * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil | ||
function objCreateFn(obj) { | ||
var func = Object["create"]; | ||
var func = ObjCreate; | ||
// Use build in Object.create | ||
@@ -58,3 +69,3 @@ if (func) { | ||
if (type !== strShimObject && type !== strShimFunction) { | ||
throw new TypeError('Object prototype may only be an Object:' + obj); | ||
throwTypeError('Object prototype may only be an Object:' + obj); | ||
} | ||
@@ -65,7 +76,21 @@ function tmpFunc() { } | ||
} | ||
function __assignFn(t) { | ||
// Most of these functions have been directly shamelessly "lifted" from the https://github.com/@microsoft/tslib and | ||
// modified to be ES3 compatible and applying several minification and tree-shaking techniques so that Application Insights | ||
// can successfully use TypeScript "importHelpers" which imports tslib during compilation but it will use these at runtime | ||
// Which is also why all of the functions have not been included as Application Insights currently doesn't use or require | ||
// them. | ||
var SymbolObj = (getGlobal() || {})["Symbol"]; | ||
var ReflectObj = (getGlobal() || {})["Reflect"]; | ||
var __hasReflect = !!ReflectObj; | ||
var strDecorate = "decorate"; | ||
var strMetadata = "metadata"; | ||
var strGetOwnPropertySymbols = "getOwnPropertySymbols"; | ||
var strIterator = "iterator"; | ||
var __objAssignFnImpl = function (t) { | ||
// tslint:disable-next-line: ban-comma-operator | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) { | ||
if (Object[strShimPrototype][strShimHasOwnProperty].call(s, p)) { | ||
if (ObjProto[strShimHasOwnProperty].call(s, p)) { | ||
t[p] = s[p]; | ||
@@ -76,6 +101,7 @@ } | ||
return t; | ||
} | ||
}; | ||
var __assignFn = ObjAssign || __objAssignFnImpl; | ||
// tslint:disable-next-line: only-arrow-functions | ||
var __extendStaticsFn = function (d, b) { | ||
__extendStaticsFn = Object["setPrototypeOf"] || | ||
var extendStaticsFn = function (d, b) { | ||
extendStaticsFn = ObjClass["setPrototypeOf"] || | ||
// tslint:disable-next-line: only-arrow-functions | ||
@@ -91,6 +117,9 @@ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
}; | ||
return __extendStaticsFn(d, b); | ||
return extendStaticsFn(d, b); | ||
}; | ||
function __extendsFn(d, b) { | ||
__extendStaticsFn(d, b); | ||
if (typeof b !== strShimFunction && b !== null) { | ||
throwTypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
} | ||
extendStaticsFn(d, b); | ||
function __() { this.constructor = d; } | ||
@@ -100,22 +129,199 @@ // tslint:disable-next-line: ban-comma-operator | ||
} | ||
var globalObj = getGlobal() || {}; | ||
// tslint:disable: only-arrow-functions | ||
(function (root, assignFn, extendsFn) { | ||
// Assign the globally scoped versions of the functions -- used when consuming individual ts files | ||
// If check is to support NativeScript where these are marked as readonly | ||
if (!root.__assign) { | ||
root.__assign = Object.assign || assignFn; | ||
function __restFn(s, e) { | ||
var t = {}; | ||
for (var k in s) { | ||
if (ObjHasOwnProperty.call(s, k) && e.indexOf(k) < 0) { | ||
t[k] = s[k]; | ||
} | ||
} | ||
if (!root.__extends) { | ||
root.__extends = extendsFn; | ||
if (s != null && typeof ObjClass[strGetOwnPropertySymbols] === strShimFunction) { | ||
for (var i = 0, p = ObjClass[strGetOwnPropertySymbols](s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && ObjProto["propertyIsEnumerable"].call(s, p[i])) { | ||
t[p[i]] = s[p[i]]; | ||
} | ||
} | ||
} | ||
})(globalObj, __assignFn, __extendsFn); | ||
// Assign local variables that will be used for embedded scenarios, if check is to support NativeScript where these are marked as readonly | ||
if (!__assign) { | ||
__assign = globalObj.__assign; | ||
return t; | ||
} | ||
if (!__extends) { | ||
__extends = globalObj.__extends; | ||
function __decorateFn(decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = ObjClass["getOwnPropertyDescriptor"](target, key) : desc, d; | ||
if (__hasReflect && typeof ReflectObj[strDecorate] === strShimFunction) { | ||
r = ReflectObj[strDecorate](decorators, target, key, desc); | ||
} | ||
else { | ||
for (var i = decorators.length - 1; i >= 0; i--) { | ||
// tslint:disable-next-line:no-conditional-assignment | ||
if (d = decorators[i]) { | ||
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
} | ||
} | ||
} | ||
// tslint:disable-next-line:ban-comma-operator | ||
return c > 3 && r && ObjDefineProperty(target, key, r), r; | ||
} | ||
function __paramFn(paramIndex, decorator) { | ||
return function (target, key) { | ||
decorator(target, key, paramIndex); | ||
}; | ||
} | ||
function __metadataFn(metadataKey, metadataValue) { | ||
if (__hasReflect && ReflectObj[strMetadata] === strShimFunction) { | ||
return ReflectObj[strMetadata](metadataKey, metadataValue); | ||
} | ||
} | ||
function __exportStarFn(m, o) { | ||
for (var p in m) { | ||
if (p !== strDefault && !ObjHasOwnProperty.call(o, p)) { | ||
__createBindingFn(o, m, p); | ||
} | ||
} | ||
} | ||
function __createBindingFn(o, m, k, k2) { | ||
if (k2 === undefined) { | ||
k2 = k; | ||
} | ||
if (ObjCreate) { | ||
ObjDefineProperty(o, k2, { | ||
enumerable: true, | ||
get: function () { | ||
return m[k]; | ||
} | ||
}); | ||
} | ||
else { | ||
o[k2] = m[k]; | ||
} | ||
} | ||
function __valuesFn(o) { | ||
var s = typeof SymbolObj === strShimFunction && SymbolObj[strIterator], m = s && o[s], i = 0; | ||
if (m) { | ||
return m.call(o); | ||
} | ||
if (o && typeof o.length === "number") { | ||
return { | ||
next: function () { | ||
if (o && i >= o.length) { | ||
o = void 0; | ||
} | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
} | ||
throwTypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
} | ||
function __readFn(o, n) { | ||
var m = typeof SymbolObj === strShimFunction && o[SymbolObj[strIterator]]; | ||
if (!m) { | ||
return o; | ||
} | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) { | ||
ar.push(r.value); | ||
} | ||
} | ||
catch (error) { | ||
e = { | ||
error: error | ||
}; | ||
} | ||
finally { | ||
try { | ||
// tslint:disable-next-line:no-conditional-assignment | ||
if (r && !r.done && (m = i["return"])) { | ||
m.call(i); | ||
} | ||
} | ||
finally { | ||
if (e) { | ||
// tslint:disable-next-line:no-unsafe-finally | ||
throw e.error; | ||
} | ||
} | ||
} | ||
return ar; | ||
} | ||
/** @deprecated */ | ||
function __spreadArraysFn() { | ||
var theArgs = arguments; | ||
// Calculate new total size | ||
for (var s = 0, i = 0, il = theArgs.length; i < il; i++) { | ||
s += theArgs[i].length; | ||
} | ||
// Create new full array | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) { | ||
for (var a = theArgs[i], j = 0, jl = a.length; j < jl; j++, k++) { | ||
r[k] = a[j]; | ||
} | ||
} | ||
return r; | ||
} | ||
function __spreadArrayFn(to, from) { | ||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) { | ||
to[j] = from[i]; | ||
} | ||
return to; | ||
} | ||
function __makeTemplateObjectFn(cooked, raw) { | ||
if (ObjDefineProperty) { | ||
ObjDefineProperty(cooked, "raw", { value: raw }); | ||
} | ||
else { | ||
cooked.raw = raw; | ||
} | ||
return cooked; | ||
} | ||
function __importStarFn(mod) { | ||
if (mod && mod.__esModule) { | ||
return mod; | ||
} | ||
var result = {}; | ||
if (mod != null) { | ||
for (var k in mod) { | ||
if (k !== strDefault && Object.prototype.hasOwnProperty.call(mod, k)) { | ||
__createBindingFn(result, mod, k); | ||
} | ||
} | ||
} | ||
// Set default module | ||
if (ObjCreate) { | ||
ObjDefineProperty(result, strDefault, { enumerable: true, value: mod }); | ||
} | ||
else { | ||
result[strDefault] = mod; | ||
} | ||
return result; | ||
} | ||
function __importDefaultFn(mod) { | ||
return (mod && mod.__esModule) ? mod : { strDefault: mod }; | ||
} | ||
export { strShimFunction, strShimObject, strShimUndefined, strShimPrototype, strShimHasOwnProperty, getGlobal, objCreateFn, __assignFn, __extendsFn }; | ||
function __exposeGlobalTsLib() { | ||
var globalObj = getGlobal() || {}; | ||
// tslint:disable: only-arrow-functions | ||
(function (root, assignFn, extendsFn, createBindingFn) { | ||
// Assign the globally scoped versions of the functions -- used when consuming individual ts files | ||
// If check is to support NativeScript where these are marked as readonly | ||
if (!root.__assign) { | ||
root.__assign = ObjAssign || assignFn; | ||
} | ||
if (!root.__extends) { | ||
root.__extends = extendsFn; | ||
} | ||
if (!root.__createBinding) { | ||
root.__createBinding = createBindingFn; | ||
} | ||
})(globalObj, __assignFn, __extendsFn, __createBindingFn); | ||
// Assign local variables that will be used for embedded scenarios, if check is to support NativeScript where these are marked as readonly | ||
if (!__assign) { | ||
__assign = globalObj.__assign; | ||
} | ||
if (!__extends) { | ||
__extends = globalObj.__extends; | ||
} | ||
if (!__createBinding) { | ||
__createBinding = globalObj.__createBinding; | ||
} | ||
} | ||
export { ObjAssign, ObjClass, ObjCreate, ObjDefineProperty, ObjHasOwnProperty, ObjProto, __assignFn, __createBindingFn, __decorateFn, __exportStarFn, __exposeGlobalTsLib, __extendsFn, __importDefaultFn, __importStarFn, __makeTemplateObjectFn, __metadataFn, __paramFn, __readFn, __restFn, __spreadArrayFn, __spreadArraysFn, __valuesFn, getGlobal, objCreateFn, strDefault, strShimFunction, strShimHasOwnProperty, strShimObject, strShimPrototype, strShimUndefined, throwTypeError }; |
/*! | ||
* Application Insights JavaScript SDK - Shim functions, 1.0.3 | ||
* Microsoft Application Insights JavaScript SDK - Shim functions, 2.0.0 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
*/ | ||
var n="function",t="object",e="undefined",o="prototype",r="hasOwnProperty";function i(){return typeof globalThis!==e&&globalThis?globalThis:typeof self!==e&&self?self:typeof window!==e&&window?window:typeof global!==e&&global?global:null}function s(e){var r=Object.create;if(r)return r(e);if(null==e)return{};var i=typeof e;if(i!==t&&i!==n)throw new TypeError("Object prototype may only be an Object:"+e);function s(){}return s[o]=e,new s}function _(n){for(var t,e=1,i=arguments.length;e<i;e++)for(var s in t=arguments[e])Object[o][r].call(t,s)&&(n[s]=t[s]);return n}var a=function(n,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)t[r](e)&&(n[e]=t[e])})(n,t)};function f(n,t){function e(){this.constructor=n}a(n,t),n[o]=null===t?s(t):(e[o]=t[o],new e)}var l,c,u,p=i()||{};c=_,u=f,(l=p).__assign||(l.__assign=Object.assign||c),l.__extends||(l.__extends=u),__assign||(__assign=p.__assign),__extends||(__extends=p.__extends);export{n as strShimFunction,t as strShimObject,e as strShimUndefined,o as strShimPrototype,r as strShimHasOwnProperty,i as getGlobal,s as objCreateFn,_ as __assignFn,f as __extendsFn}; | ||
var strShimFunction = "function"; | ||
var strShimObject = "object"; | ||
var strShimUndefined = "undefined"; | ||
var strShimPrototype = "prototype"; | ||
var strShimHasOwnProperty = "hasOwnProperty"; | ||
var strDefault = "default"; | ||
var ObjClass = Object; | ||
var ObjProto = ObjClass[strShimPrototype]; | ||
var ObjAssign = ObjClass["assign"]; | ||
var ObjCreate = ObjClass["create"]; | ||
var ObjDefineProperty = ObjClass["defineProperty"]; | ||
var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty]; | ||
/** | ||
* Returns the current global scope object, for a normal web page this will be the current | ||
* window, for a Web Worker this will be current worker global scope via "self". The internal | ||
* implementation returns the first available instance object in the following order | ||
* - globalThis (New standard) | ||
* - self (Will return the current window instance for supported browsers) | ||
* - window (fallback for older browser implementations) | ||
* - global (NodeJS standard) | ||
* - <null> (When all else fails) | ||
* While the return type is a Window for the normal case, not all environments will support all | ||
* of the properties or functions. | ||
*/ | ||
function getGlobal() { | ||
if (typeof globalThis !== strShimUndefined && globalThis) { | ||
return globalThis; | ||
} | ||
if (typeof self !== strShimUndefined && self) { | ||
return self; | ||
} | ||
if (typeof window !== strShimUndefined && window) { | ||
return window; | ||
} | ||
if (typeof global !== strShimUndefined && global) { | ||
return global; | ||
} | ||
return null; | ||
} | ||
function throwTypeError(message) { | ||
throw new TypeError(message); | ||
} | ||
/** | ||
* Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil | ||
* for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation. | ||
* Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations | ||
* @param obj Object to use as a prototype. May be null | ||
*/ | ||
function objCreateFn(obj) { | ||
var func = ObjCreate; | ||
// Use build in Object.create | ||
if (func) { | ||
// Use Object create method if it exists | ||
return func(obj); | ||
} | ||
if (obj == null) { | ||
return {}; | ||
} | ||
var type = typeof obj; | ||
if (type !== strShimObject && type !== strShimFunction) { | ||
throwTypeError('Object prototype may only be an Object:' + obj); | ||
} | ||
function tmpFunc() { } | ||
tmpFunc[strShimPrototype] = obj; | ||
return new tmpFunc(); | ||
} | ||
// Most of these functions have been directly shamelessly "lifted" from the https://github.com/@microsoft/tslib and | ||
// modified to be ES3 compatible and applying several minification and tree-shaking techniques so that Application Insights | ||
// can successfully use TypeScript "importHelpers" which imports tslib during compilation but it will use these at runtime | ||
// Which is also why all of the functions have not been included as Application Insights currently doesn't use or require | ||
// them. | ||
var SymbolObj = (getGlobal() || {})["Symbol"]; | ||
var ReflectObj = (getGlobal() || {})["Reflect"]; | ||
var __hasReflect = !!ReflectObj; | ||
var strDecorate = "decorate"; | ||
var strMetadata = "metadata"; | ||
var strGetOwnPropertySymbols = "getOwnPropertySymbols"; | ||
var strIterator = "iterator"; | ||
var __objAssignFnImpl = function (t) { | ||
// tslint:disable-next-line: ban-comma-operator | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) { | ||
if (ObjProto[strShimHasOwnProperty].call(s, p)) { | ||
t[p] = s[p]; | ||
} | ||
} | ||
} | ||
return t; | ||
}; | ||
var __assignFn = ObjAssign || __objAssignFnImpl; | ||
// tslint:disable-next-line: only-arrow-functions | ||
var extendStaticsFn = function (d, b) { | ||
extendStaticsFn = ObjClass["setPrototypeOf"] || | ||
// tslint:disable-next-line: only-arrow-functions | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
// tslint:disable-next-line: only-arrow-functions | ||
function (d, b) { | ||
for (var p in b) { | ||
if (b[strShimHasOwnProperty](p)) { | ||
d[p] = b[p]; | ||
} | ||
} | ||
}; | ||
return extendStaticsFn(d, b); | ||
}; | ||
function __extendsFn(d, b) { | ||
if (typeof b !== strShimFunction && b !== null) { | ||
throwTypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
} | ||
extendStaticsFn(d, b); | ||
function __() { this.constructor = d; } | ||
// tslint:disable-next-line: ban-comma-operator | ||
d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __()); | ||
} | ||
function __restFn(s, e) { | ||
var t = {}; | ||
for (var k in s) { | ||
if (ObjHasOwnProperty.call(s, k) && e.indexOf(k) < 0) { | ||
t[k] = s[k]; | ||
} | ||
} | ||
if (s != null && typeof ObjClass[strGetOwnPropertySymbols] === strShimFunction) { | ||
for (var i = 0, p = ObjClass[strGetOwnPropertySymbols](s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && ObjProto["propertyIsEnumerable"].call(s, p[i])) { | ||
t[p[i]] = s[p[i]]; | ||
} | ||
} | ||
} | ||
return t; | ||
} | ||
function __decorateFn(decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = ObjClass["getOwnPropertyDescriptor"](target, key) : desc, d; | ||
if (__hasReflect && typeof ReflectObj[strDecorate] === strShimFunction) { | ||
r = ReflectObj[strDecorate](decorators, target, key, desc); | ||
} | ||
else { | ||
for (var i = decorators.length - 1; i >= 0; i--) { | ||
// tslint:disable-next-line:no-conditional-assignment | ||
if (d = decorators[i]) { | ||
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
} | ||
} | ||
} | ||
// tslint:disable-next-line:ban-comma-operator | ||
return c > 3 && r && ObjDefineProperty(target, key, r), r; | ||
} | ||
function __paramFn(paramIndex, decorator) { | ||
return function (target, key) { | ||
decorator(target, key, paramIndex); | ||
}; | ||
} | ||
function __metadataFn(metadataKey, metadataValue) { | ||
if (__hasReflect && ReflectObj[strMetadata] === strShimFunction) { | ||
return ReflectObj[strMetadata](metadataKey, metadataValue); | ||
} | ||
} | ||
function __exportStarFn(m, o) { | ||
for (var p in m) { | ||
if (p !== strDefault && !ObjHasOwnProperty.call(o, p)) { | ||
__createBindingFn(o, m, p); | ||
} | ||
} | ||
} | ||
function __createBindingFn(o, m, k, k2) { | ||
if (k2 === undefined) { | ||
k2 = k; | ||
} | ||
if (ObjCreate) { | ||
ObjDefineProperty(o, k2, { | ||
enumerable: true, | ||
get: function () { | ||
return m[k]; | ||
} | ||
}); | ||
} | ||
else { | ||
o[k2] = m[k]; | ||
} | ||
} | ||
function __valuesFn(o) { | ||
var s = typeof SymbolObj === strShimFunction && SymbolObj[strIterator], m = s && o[s], i = 0; | ||
if (m) { | ||
return m.call(o); | ||
} | ||
if (o && typeof o.length === "number") { | ||
return { | ||
next: function () { | ||
if (o && i >= o.length) { | ||
o = void 0; | ||
} | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
} | ||
throwTypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
} | ||
function __readFn(o, n) { | ||
var m = typeof SymbolObj === strShimFunction && o[SymbolObj[strIterator]]; | ||
if (!m) { | ||
return o; | ||
} | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) { | ||
ar.push(r.value); | ||
} | ||
} | ||
catch (error) { | ||
e = { | ||
error: error | ||
}; | ||
} | ||
finally { | ||
try { | ||
// tslint:disable-next-line:no-conditional-assignment | ||
if (r && !r.done && (m = i["return"])) { | ||
m.call(i); | ||
} | ||
} | ||
finally { | ||
if (e) { | ||
// tslint:disable-next-line:no-unsafe-finally | ||
throw e.error; | ||
} | ||
} | ||
} | ||
return ar; | ||
} | ||
/** @deprecated */ | ||
function __spreadArraysFn() { | ||
var theArgs = arguments; | ||
// Calculate new total size | ||
for (var s = 0, i = 0, il = theArgs.length; i < il; i++) { | ||
s += theArgs[i].length; | ||
} | ||
// Create new full array | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) { | ||
for (var a = theArgs[i], j = 0, jl = a.length; j < jl; j++, k++) { | ||
r[k] = a[j]; | ||
} | ||
} | ||
return r; | ||
} | ||
function __spreadArrayFn(to, from) { | ||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) { | ||
to[j] = from[i]; | ||
} | ||
return to; | ||
} | ||
function __makeTemplateObjectFn(cooked, raw) { | ||
if (ObjDefineProperty) { | ||
ObjDefineProperty(cooked, "raw", { value: raw }); | ||
} | ||
else { | ||
cooked.raw = raw; | ||
} | ||
return cooked; | ||
} | ||
function __importStarFn(mod) { | ||
if (mod && mod.__esModule) { | ||
return mod; | ||
} | ||
var result = {}; | ||
if (mod != null) { | ||
for (var k in mod) { | ||
if (k !== strDefault && Object.prototype.hasOwnProperty.call(mod, k)) { | ||
__createBindingFn(result, mod, k); | ||
} | ||
} | ||
} | ||
// Set default module | ||
if (ObjCreate) { | ||
ObjDefineProperty(result, strDefault, { enumerable: true, value: mod }); | ||
} | ||
else { | ||
result[strDefault] = mod; | ||
} | ||
return result; | ||
} | ||
function __importDefaultFn(mod) { | ||
return (mod && mod.__esModule) ? mod : { strDefault: mod }; | ||
} | ||
function __exposeGlobalTsLib() { | ||
var globalObj = getGlobal() || {}; | ||
// tslint:disable: only-arrow-functions | ||
(function (root, assignFn, extendsFn, createBindingFn) { | ||
// Assign the globally scoped versions of the functions -- used when consuming individual ts files | ||
// If check is to support NativeScript where these are marked as readonly | ||
if (!root.__assign) { | ||
root.__assign = ObjAssign || assignFn; | ||
} | ||
if (!root.__extends) { | ||
root.__extends = extendsFn; | ||
} | ||
if (!root.__createBinding) { | ||
root.__createBinding = createBindingFn; | ||
} | ||
})(globalObj, __assignFn, __extendsFn, __createBindingFn); | ||
// Assign local variables that will be used for embedded scenarios, if check is to support NativeScript where these are marked as readonly | ||
if (!__assign) { | ||
__assign = globalObj.__assign; | ||
} | ||
if (!__extends) { | ||
__extends = globalObj.__extends; | ||
} | ||
if (!__createBinding) { | ||
__createBinding = globalObj.__createBinding; | ||
} | ||
} | ||
export { ObjAssign, ObjClass, ObjCreate, ObjDefineProperty, ObjHasOwnProperty, ObjProto, __assignFn, __createBindingFn, __decorateFn, __exportStarFn, __exposeGlobalTsLib, __extendsFn, __importDefaultFn, __importStarFn, __makeTemplateObjectFn, __metadataFn, __paramFn, __readFn, __restFn, __spreadArrayFn, __spreadArraysFn, __valuesFn, getGlobal, objCreateFn, strDefault, strShimFunction, strShimHasOwnProperty, strShimObject, strShimPrototype, strShimUndefined, throwTypeError }; |
/*! | ||
* Application Insights JavaScript SDK - Shim functions, 1.0.3 | ||
* Microsoft Application Insights JavaScript SDK - Shim functions, 2.0.0 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -8,3 +8,3 @@ */ | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(factory((global.Microsoft = global.Microsoft || {}, global.Microsoft.ApplicationInsights = global.Microsoft.ApplicationInsights || {}, global.Microsoft.ApplicationInsights.Shims = {}))); | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.Microsoft = global.Microsoft || {}, global.Microsoft.ApplicationInsights = global.Microsoft.ApplicationInsights || {}, global.Microsoft.ApplicationInsights.Shims = {}))); | ||
}(this, (function (exports) { 'use strict'; | ||
@@ -17,2 +17,10 @@ | ||
var strShimHasOwnProperty = "hasOwnProperty"; | ||
var strDefault = "default"; | ||
var ObjClass = Object; | ||
var ObjProto = ObjClass[strShimPrototype]; | ||
var ObjAssign = ObjClass["assign"]; | ||
var ObjCreate = ObjClass["create"]; | ||
var ObjDefineProperty = ObjClass["defineProperty"]; | ||
var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty]; | ||
/** | ||
@@ -45,2 +53,5 @@ * Returns the current global scope object, for a normal web page this will be the current | ||
} | ||
function throwTypeError(message) { | ||
throw new TypeError(message); | ||
} | ||
/** | ||
@@ -53,3 +64,3 @@ * Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil | ||
function objCreateFn(obj) { | ||
var func = Object["create"]; | ||
var func = ObjCreate; | ||
// Use build in Object.create | ||
@@ -65,3 +76,3 @@ if (func) { | ||
if (type !== strShimObject && type !== strShimFunction) { | ||
throw new TypeError('Object prototype may only be an Object:' + obj); | ||
throwTypeError('Object prototype may only be an Object:' + obj); | ||
} | ||
@@ -72,7 +83,21 @@ function tmpFunc() { } | ||
} | ||
function __assignFn(t) { | ||
// Most of these functions have been directly shamelessly "lifted" from the https://github.com/@microsoft/tslib and | ||
// modified to be ES3 compatible and applying several minification and tree-shaking techniques so that Application Insights | ||
// can successfully use TypeScript "importHelpers" which imports tslib during compilation but it will use these at runtime | ||
// Which is also why all of the functions have not been included as Application Insights currently doesn't use or require | ||
// them. | ||
var SymbolObj = (getGlobal() || {})["Symbol"]; | ||
var ReflectObj = (getGlobal() || {})["Reflect"]; | ||
var __hasReflect = !!ReflectObj; | ||
var strDecorate = "decorate"; | ||
var strMetadata = "metadata"; | ||
var strGetOwnPropertySymbols = "getOwnPropertySymbols"; | ||
var strIterator = "iterator"; | ||
var __objAssignFnImpl = function (t) { | ||
// tslint:disable-next-line: ban-comma-operator | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) { | ||
if (Object[strShimPrototype][strShimHasOwnProperty].call(s, p)) { | ||
if (ObjProto[strShimHasOwnProperty].call(s, p)) { | ||
t[p] = s[p]; | ||
@@ -83,6 +108,7 @@ } | ||
return t; | ||
} | ||
}; | ||
var __assignFn = ObjAssign || __objAssignFnImpl; | ||
// tslint:disable-next-line: only-arrow-functions | ||
var __extendStaticsFn = function (d, b) { | ||
__extendStaticsFn = Object["setPrototypeOf"] || | ||
var extendStaticsFn = function (d, b) { | ||
extendStaticsFn = ObjClass["setPrototypeOf"] || | ||
// tslint:disable-next-line: only-arrow-functions | ||
@@ -98,6 +124,9 @@ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
}; | ||
return __extendStaticsFn(d, b); | ||
return extendStaticsFn(d, b); | ||
}; | ||
function __extendsFn(d, b) { | ||
__extendStaticsFn(d, b); | ||
if (typeof b !== strShimFunction && b !== null) { | ||
throwTypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
} | ||
extendStaticsFn(d, b); | ||
function __() { this.constructor = d; } | ||
@@ -107,31 +136,230 @@ // tslint:disable-next-line: ban-comma-operator | ||
} | ||
var globalObj = getGlobal() || {}; | ||
// tslint:disable: only-arrow-functions | ||
(function (root, assignFn, extendsFn) { | ||
// Assign the globally scoped versions of the functions -- used when consuming individual ts files | ||
// If check is to support NativeScript where these are marked as readonly | ||
if (!root.__assign) { | ||
root.__assign = Object.assign || assignFn; | ||
function __restFn(s, e) { | ||
var t = {}; | ||
for (var k in s) { | ||
if (ObjHasOwnProperty.call(s, k) && e.indexOf(k) < 0) { | ||
t[k] = s[k]; | ||
} | ||
} | ||
if (!root.__extends) { | ||
root.__extends = extendsFn; | ||
if (s != null && typeof ObjClass[strGetOwnPropertySymbols] === strShimFunction) { | ||
for (var i = 0, p = ObjClass[strGetOwnPropertySymbols](s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && ObjProto["propertyIsEnumerable"].call(s, p[i])) { | ||
t[p[i]] = s[p[i]]; | ||
} | ||
} | ||
} | ||
})(globalObj, __assignFn, __extendsFn); | ||
// Assign local variables that will be used for embedded scenarios, if check is to support NativeScript where these are marked as readonly | ||
if (!__assign) { | ||
__assign = globalObj.__assign; | ||
return t; | ||
} | ||
if (!__extends) { | ||
__extends = globalObj.__extends; | ||
function __decorateFn(decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = ObjClass["getOwnPropertyDescriptor"](target, key) : desc, d; | ||
if (__hasReflect && typeof ReflectObj[strDecorate] === strShimFunction) { | ||
r = ReflectObj[strDecorate](decorators, target, key, desc); | ||
} | ||
else { | ||
for (var i = decorators.length - 1; i >= 0; i--) { | ||
// tslint:disable-next-line:no-conditional-assignment | ||
if (d = decorators[i]) { | ||
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
} | ||
} | ||
} | ||
// tslint:disable-next-line:ban-comma-operator | ||
return c > 3 && r && ObjDefineProperty(target, key, r), r; | ||
} | ||
function __paramFn(paramIndex, decorator) { | ||
return function (target, key) { | ||
decorator(target, key, paramIndex); | ||
}; | ||
} | ||
function __metadataFn(metadataKey, metadataValue) { | ||
if (__hasReflect && ReflectObj[strMetadata] === strShimFunction) { | ||
return ReflectObj[strMetadata](metadataKey, metadataValue); | ||
} | ||
} | ||
function __exportStarFn(m, o) { | ||
for (var p in m) { | ||
if (p !== strDefault && !ObjHasOwnProperty.call(o, p)) { | ||
__createBindingFn(o, m, p); | ||
} | ||
} | ||
} | ||
function __createBindingFn(o, m, k, k2) { | ||
if (k2 === undefined) { | ||
k2 = k; | ||
} | ||
if (ObjCreate) { | ||
ObjDefineProperty(o, k2, { | ||
enumerable: true, | ||
get: function () { | ||
return m[k]; | ||
} | ||
}); | ||
} | ||
else { | ||
o[k2] = m[k]; | ||
} | ||
} | ||
function __valuesFn(o) { | ||
var s = typeof SymbolObj === strShimFunction && SymbolObj[strIterator], m = s && o[s], i = 0; | ||
if (m) { | ||
return m.call(o); | ||
} | ||
if (o && typeof o.length === "number") { | ||
return { | ||
next: function () { | ||
if (o && i >= o.length) { | ||
o = void 0; | ||
} | ||
return { value: o && o[i++], done: !o }; | ||
} | ||
}; | ||
} | ||
throwTypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | ||
} | ||
function __readFn(o, n) { | ||
var m = typeof SymbolObj === strShimFunction && o[SymbolObj[strIterator]]; | ||
if (!m) { | ||
return o; | ||
} | ||
var i = m.call(o), r, ar = [], e; | ||
try { | ||
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) { | ||
ar.push(r.value); | ||
} | ||
} | ||
catch (error) { | ||
e = { | ||
error: error | ||
}; | ||
} | ||
finally { | ||
try { | ||
// tslint:disable-next-line:no-conditional-assignment | ||
if (r && !r.done && (m = i["return"])) { | ||
m.call(i); | ||
} | ||
} | ||
finally { | ||
if (e) { | ||
// tslint:disable-next-line:no-unsafe-finally | ||
throw e.error; | ||
} | ||
} | ||
} | ||
return ar; | ||
} | ||
/** @deprecated */ | ||
function __spreadArraysFn() { | ||
var theArgs = arguments; | ||
// Calculate new total size | ||
for (var s = 0, i = 0, il = theArgs.length; i < il; i++) { | ||
s += theArgs[i].length; | ||
} | ||
// Create new full array | ||
for (var r = Array(s), k = 0, i = 0; i < il; i++) { | ||
for (var a = theArgs[i], j = 0, jl = a.length; j < jl; j++, k++) { | ||
r[k] = a[j]; | ||
} | ||
} | ||
return r; | ||
} | ||
function __spreadArrayFn(to, from) { | ||
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) { | ||
to[j] = from[i]; | ||
} | ||
return to; | ||
} | ||
function __makeTemplateObjectFn(cooked, raw) { | ||
if (ObjDefineProperty) { | ||
ObjDefineProperty(cooked, "raw", { value: raw }); | ||
} | ||
else { | ||
cooked.raw = raw; | ||
} | ||
return cooked; | ||
} | ||
function __importStarFn(mod) { | ||
if (mod && mod.__esModule) { | ||
return mod; | ||
} | ||
var result = {}; | ||
if (mod != null) { | ||
for (var k in mod) { | ||
if (k !== strDefault && Object.prototype.hasOwnProperty.call(mod, k)) { | ||
__createBindingFn(result, mod, k); | ||
} | ||
} | ||
} | ||
// Set default module | ||
if (ObjCreate) { | ||
ObjDefineProperty(result, strDefault, { enumerable: true, value: mod }); | ||
} | ||
else { | ||
result[strDefault] = mod; | ||
} | ||
return result; | ||
} | ||
function __importDefaultFn(mod) { | ||
return (mod && mod.__esModule) ? mod : { strDefault: mod }; | ||
} | ||
function __exposeGlobalTsLib() { | ||
var globalObj = getGlobal() || {}; | ||
// tslint:disable: only-arrow-functions | ||
(function (root, assignFn, extendsFn, createBindingFn) { | ||
// Assign the globally scoped versions of the functions -- used when consuming individual ts files | ||
// If check is to support NativeScript where these are marked as readonly | ||
if (!root.__assign) { | ||
root.__assign = ObjAssign || assignFn; | ||
} | ||
if (!root.__extends) { | ||
root.__extends = extendsFn; | ||
} | ||
if (!root.__createBinding) { | ||
root.__createBinding = createBindingFn; | ||
} | ||
})(globalObj, __assignFn, __extendsFn, __createBindingFn); | ||
// Assign local variables that will be used for embedded scenarios, if check is to support NativeScript where these are marked as readonly | ||
if (!__assign) { | ||
__assign = globalObj.__assign; | ||
} | ||
if (!__extends) { | ||
__extends = globalObj.__extends; | ||
} | ||
if (!__createBinding) { | ||
__createBinding = globalObj.__createBinding; | ||
} | ||
} | ||
exports.ObjAssign = ObjAssign; | ||
exports.ObjClass = ObjClass; | ||
exports.ObjCreate = ObjCreate; | ||
exports.ObjDefineProperty = ObjDefineProperty; | ||
exports.ObjHasOwnProperty = ObjHasOwnProperty; | ||
exports.ObjProto = ObjProto; | ||
exports.__assignFn = __assignFn; | ||
exports.__createBindingFn = __createBindingFn; | ||
exports.__decorateFn = __decorateFn; | ||
exports.__exportStarFn = __exportStarFn; | ||
exports.__exposeGlobalTsLib = __exposeGlobalTsLib; | ||
exports.__extendsFn = __extendsFn; | ||
exports.__importDefaultFn = __importDefaultFn; | ||
exports.__importStarFn = __importStarFn; | ||
exports.__makeTemplateObjectFn = __makeTemplateObjectFn; | ||
exports.__metadataFn = __metadataFn; | ||
exports.__paramFn = __paramFn; | ||
exports.__readFn = __readFn; | ||
exports.__restFn = __restFn; | ||
exports.__spreadArrayFn = __spreadArrayFn; | ||
exports.__spreadArraysFn = __spreadArraysFn; | ||
exports.__valuesFn = __valuesFn; | ||
exports.getGlobal = getGlobal; | ||
exports.objCreateFn = objCreateFn; | ||
exports.strDefault = strDefault; | ||
exports.strShimFunction = strShimFunction; | ||
exports.strShimHasOwnProperty = strShimHasOwnProperty; | ||
exports.strShimObject = strShimObject; | ||
exports.strShimPrototype = strShimPrototype; | ||
exports.strShimUndefined = strShimUndefined; | ||
exports.strShimPrototype = strShimPrototype; | ||
exports.strShimHasOwnProperty = strShimHasOwnProperty; | ||
exports.getGlobal = getGlobal; | ||
exports.objCreateFn = objCreateFn; | ||
exports.__assignFn = __assignFn; | ||
exports.__extendsFn = __extendsFn; | ||
exports.throwTypeError = throwTypeError; | ||
@@ -138,0 +366,0 @@ (function(obj, prop, descriptor) { /* ai_es3_polyfil defineProperty */ var func = Object["defineProperty"]; if (func) { try { return func(obj, prop, descriptor); } catch(e) { /* IE8 defines defineProperty, but will throw */ } } if (descriptor && typeof descriptor.value !== undefined) { obj[prop] = descriptor.value; } return obj; })(exports, '__esModule', { value: true }); |
/*! | ||
* Application Insights JavaScript SDK - Shim functions, 1.0.3 | ||
* Microsoft Application Insights JavaScript SDK - Shim functions, 2.0.0 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
*/ | ||
var t=this,n=function(t){"use strict";var i="function",r="object",n="undefined",s="prototype",f="hasOwnProperty";function e(){return typeof globalThis!=n&&globalThis?globalThis:typeof self!=n&&self?self:typeof window!=n&&window?window:typeof global!=n&&global?global:null}function o(t){var n=Object.create;if(n)return n(t);if(null==t)return{};var e=typeof t;if(e!==r&&e!==i)throw new TypeError("Object prototype may only be an Object:"+t);function o(){}return o[s]=t,new o}function a(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var i in n=arguments[e])Object[s][f].call(n,i)&&(t[i]=n[i]);return t}var c=function(t,n){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n[f](e)&&(t[e]=n[e])})(t,n)};function l(t,n){function e(){this.constructor=t}c(t,n),t[s]=null===n?o(n):(e[s]=n[s],new e)}var u,_=e()||{},p=l;(u=_).__assign||(u.__assign=Object.assign||a),u.__extends||(u.__extends=p),__assign=__assign||_.__assign,__extends=__extends||_.__extends,t.strShimFunction=i,t.strShimObject=r,t.strShimUndefined=n,t.strShimPrototype=s,t.strShimHasOwnProperty=f,t.getGlobal=e,t.objCreateFn=o,t.__assignFn=a,t.__extendsFn=l,function(t,n,e){var o=Object.defineProperty;if(o)try{return o(t,n,e)}catch(i){}typeof e.value!==undefined&&(t[n]=e.value)}(t,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t.Microsoft=t.Microsoft||{},t.Microsoft.ApplicationInsights=t.Microsoft.ApplicationInsights||{},t.Microsoft.ApplicationInsights.Shims={})); | ||
var e=this,n=function(e){"use strict";var f="function",r="object",n="undefined",o="prototype",i="hasOwnProperty",a="default",u=Object,l=u[o],s=u.assign,c=u.create,_=u.defineProperty,p=l[i];function d(){return typeof globalThis!=n&&globalThis?globalThis:typeof self!=n&&self?self:typeof window!=n&&window?window:typeof global!=n&&global?global:null}function y(e){throw new TypeError(e)}function g(e){if(c)return c(e);if(null==e)return{};var n=typeof e;function t(){}return n!==r&&n!==f&&y("Object prototype may only be an Object:"+e),t[o]=e,new t}var b=(d()||{}).Symbol,h=(d()||{}).Reflect,v=!!h,m="decorate",t="metadata",O="getOwnPropertySymbols",w="iterator",j=s||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])l[i].call(n,o)&&(e[o]=n[o]);return e},F=function(e,n){return(F=u.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[i](t)&&(e[t]=n[t])})(e,n)};function x(e,n){function t(){this.constructor=e}typeof n!==f&&null!==n&&y("Class extends value "+n+" is not a constructor or null"),F(e,n),e[o]=null===n?g(n):(t[o]=n[o],new t)}function P(e,n,t,r){r===undefined&&(r=t),c?_(e,r,{enumerable:!0,get:function(){return n[t]}}):e[r]=n[t]}e.ObjAssign=s,e.ObjClass=u,e.ObjCreate=c,e.ObjDefineProperty=_,e.ObjHasOwnProperty=p,e.ObjProto=l,e.__assignFn=j,e.__createBindingFn=P,e.__decorateFn=function(e,n,t,r){var o,i=arguments.length,a=i<3?n:null===r?r=u.getOwnPropertyDescriptor(n,t):r;if(v&&typeof h[m]===f)a=h[m](e,n,t,r);else for(var l=e.length-1;0<=l;l--)(o=e[l])&&(a=(i<3?o(a):3<i?o(n,t,a):o(n,t))||a);return 3<i&&a&&_(n,t,a),a},e.__exportStarFn=function(e,n){for(var t in e)t===a||p.call(n,t)||P(n,e,t)},e.__exposeGlobalTsLib=function(){var e,n=d()||{},t=x,r=P;(e=n).__assign||(e.__assign=s||j),e.__extends||(e.__extends=t),e.__createBinding||(e.__createBinding=r),__assign=__assign||n.__assign,__extends=__extends||n.__extends,__createBinding=__createBinding||n.__createBinding},e.__extendsFn=x,e.__importDefaultFn=function(e){return e&&e.__esModule?e:{strDefault:e}},e.__importStarFn=function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var t in e)t!==a&&Object.prototype.hasOwnProperty.call(e,t)&&P(n,e,t);return c?_(n,a,{enumerable:!0,value:e}):n[a]=e,n},e.__makeTemplateObjectFn=function(e,n){return _?_(e,"raw",{value:n}):e.raw=n,e},e.__metadataFn=function(e,n){if(v&&h[t]===f)return h[t](e,n)},e.__paramFn=function(t,r){return function(e,n){r(e,n,t)}},e.__readFn=function(e,n){var t=typeof b===f&&e[b[w]];if(!t)return e;var r,o,i=t.call(e),a=[];try{for(;(void 0===n||0<n--)&&!(r=i.next()).done;)a.push(r.value)}catch(l){o={error:l}}finally{try{r&&!r.done&&(t=i["return"])&&t.call(i)}finally{if(o)throw o.error}}return a},e.__restFn=function(e,n){var t,r={};for(t in e)p.call(e,t)&&!~n.indexOf(t)&&(r[t]=e[t]);if(null!=e&&typeof u[O]===f)for(var o=0,i=u[O](e);o<i.length;o++)!~n.indexOf(i[o])&&l.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]]);return r},e.__spreadArrayFn=function(e,n){for(var t=0,r=n.length,o=e.length;t<r;t++,o++)e[o]=n[t];return e},e.__spreadArraysFn=function(){for(var e=arguments,n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(var o=Array(n),i=0,t=0;t<r;t++)for(var a=e[t],l=0,f=a.length;l<f;l++,i++)o[i]=a[l];return o},e.__valuesFn=function(e){var n=typeof b===f&&b[w],t=n&&e[n],r=0;return t?t.call(e):e&&"number"==typeof e.length?{next:function(){return{value:(e=e&&r>=e.length?void 0:e)&&e[r++],done:!e}}}:void y(n?"Object is not iterable.":"Symbol.iterator is not defined.")},e.getGlobal=d,e.objCreateFn=g,e.strDefault=a,e.strShimFunction=f,e.strShimHasOwnProperty=i,e.strShimObject=r,e.strShimPrototype=o,e.strShimUndefined=n,e.throwTypeError=y,function(e,n,t){var r=Object.defineProperty;if(r)try{return r(e,n,t)}catch(o){}typeof t.value!==undefined&&(e[n]=t.value)}(e,"__esModule",{value:!0})};"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(((e="undefined"!=typeof globalThis?globalThis:e||self).Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights=e.Microsoft.ApplicationInsights||{},e.Microsoft.ApplicationInsights.Shims={})); |
{ | ||
"name": "@microsoft/applicationinsights-shims", | ||
"author": "Microsoft Corporation", | ||
"version": "1.0.3", | ||
"author": "Microsoft Application Insights Team", | ||
"version": "2.0.0", | ||
"description": "Microsoft Application Insights JavaScript SDK - Shim functions", | ||
"homepage": "https://github.com/microsoft/ApplicationInsights-JS/tree/master/tools/shims", | ||
"keywords": [ | ||
@@ -31,19 +32,16 @@ "azure", | ||
"sideEffects": [ | ||
"**/*.js", | ||
"**/*.ts" | ||
"**/TsLibGlobals.js", | ||
"**/TsLibGlobals.ts" | ||
], | ||
"devDependencies": { | ||
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0", | ||
"@microsoft/applicationinsights-rollup-es3" : "1.1.3", | ||
"grunt": "1.0.1", | ||
"grunt-contrib-clean": "^1.1.0", | ||
"grunt-contrib-uglify": "3.1.0", | ||
"grunt": "^1.3.0", | ||
"grunt-contrib-qunit": "^3.1.0", | ||
"grunt-ts": "^6.0.0-beta.15", | ||
"grunt-tslint": "^5.0.2", | ||
"rollup-plugin-copy": "^3.1.0", | ||
"rollup-plugin-node-resolve": "^3.4.0", | ||
"rollup-plugin-replace": "^2.1.0", | ||
"rollup-plugin-uglify": "^6.0.0", | ||
"grunt-ts": "^6.0.0-beta.22", | ||
"@rollup/plugin-commonjs": "^15.1.0", | ||
"@rollup/plugin-node-resolve": "^9.0.0", | ||
"@rollup/plugin-replace": "^2.3.3", | ||
"rollup-plugin-minify-es": "^1.1.1", | ||
"rollup": "^0.66.0", | ||
"rollup": "^2.32.0", | ||
"tslint": "^5.19.0", | ||
@@ -50,0 +48,0 @@ "tslint-config-prettier": "^1.18.0", |
@@ -12,5 +12,17 @@ # Microsoft Application Insights JavaScript SDK - Shims | ||
While the Application Insights JS SDK will use the stubs defined in this packaging for the browser instances (those that are | ||
uploaded to the CDN) they are built using the polyfill pattern, so if a global implementation of __extend() and __assign() already exist | ||
uploaded to the CDN) they are built using the polyfill pattern, so if a global implementation of __extends() and __assign() already exist | ||
those versions will be used. | ||
## Global _extends() and __assign() changes - v2.0.0 or greater | ||
From v2.0.0 or greater the globally defined ```__extends()``` and ```__assign()``` methods are no longer exposed as global by default. | ||
If you need to expose the TsLib helpers globally (which occurred by default for v1.x.x) you now will need to import and call the ```__exposeGlobalTsLib()``` function. | ||
```javascript | ||
import { __exposeGlobalTsLib } from "@microsoft/applicationinsights-shims"; | ||
__exposeGlobalTsLib(); | ||
``` | ||
## Build: | ||
@@ -17,0 +29,0 @@ ``` |
@@ -1,27 +0,4 @@ | ||
export declare const strShimFunction = "function"; | ||
export declare const strShimObject = "object"; | ||
export declare const strShimUndefined = "undefined"; | ||
export declare const strShimPrototype = "prototype"; | ||
export declare const strShimHasOwnProperty = "hasOwnProperty"; | ||
/** | ||
* Returns the current global scope object, for a normal web page this will be the current | ||
* window, for a Web Worker this will be current worker global scope via "self". The internal | ||
* implementation returns the first available instance object in the following order | ||
* - globalThis (New standard) | ||
* - self (Will return the current window instance for supported browsers) | ||
* - window (fallback for older browser implementations) | ||
* - global (NodeJS standard) | ||
* - <null> (When all else fails) | ||
* While the return type is a Window for the normal case, not all environments will support all | ||
* of the properties or functions. | ||
*/ | ||
export declare function getGlobal(): Window; | ||
/** | ||
* Creates an object that has the specified prototype, and that optionally contains specified properties. This helper exists to avoid adding a polyfil | ||
* for older browsers that do not define Object.create eg. ES3 only, IE8 just in case any page checks for presence/absence of the prototype implementation. | ||
* Note: For consistency this will not use the Object.create implementation if it exists as this would cause a testing requirement to test with and without the implementations | ||
* @param obj Object to use as a prototype. May be null | ||
*/ | ||
export declare function objCreateFn(obj: any): any; | ||
export declare function __assignFn(t: any): any; | ||
export declare function __extendsFn(d: any, b: any): void; | ||
export { strShimFunction, strShimObject, strShimUndefined, strShimPrototype, strShimHasOwnProperty, strDefault, ObjClass, ObjProto, ObjAssign, ObjCreate, ObjDefineProperty, ObjHasOwnProperty } from "./Constants"; | ||
export { throwTypeError, objCreateFn, getGlobal } from "./Helpers"; | ||
export { __assignFn, __extendsFn, __restFn, __spreadArrayFn, __spreadArraysFn, __decorateFn, __paramFn, __metadataFn, __createBindingFn, __valuesFn, __readFn, __makeTemplateObjectFn, __importDefaultFn, __importStarFn, __exportStarFn } from "./TsLibShims"; | ||
export { __exposeGlobalTsLib } from "./TsLibGlobals"; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
111766
14
25
1797
0
55
2