@microsoft/applicationinsights-shims
Advanced tools
Comparing version 2.0.2 to 3.0.0
/*! | ||
* Microsoft Application Insights JavaScript SDK - Shim functions, 2.0.2 | ||
* Microsoft Application Insights JavaScript SDK - Shim functions, 3.0.0 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
@@ -15,77 +15,152 @@ */ | ||
var strShimPrototype = "prototype"; | ||
var strShimHasOwnProperty = "hasOwnProperty"; | ||
var strDefault = "default"; | ||
var ObjClass$1 = Object; | ||
var ObjProto$1 = ObjClass$1[strShimPrototype]; | ||
var UNDEF_VALUE = undefined; | ||
var EMPTY = ""; | ||
var FUNCTION = "function"; | ||
var NUMBER = "number"; | ||
var OBJECT = "object"; | ||
var PROTOTYPE = "prototype"; | ||
var UNDEFINED = "undefined"; | ||
var ObjClass = Object; | ||
var ObjProto = ObjClass[strShimPrototype]; | ||
var ObjAssign = ObjClass["assign"]; | ||
var ObjCreate = ObjClass["create"]; | ||
var ObjDefineProperty = ObjClass["defineProperty"]; | ||
var ObjHasOwnProperty = ObjProto[strShimHasOwnProperty]; | ||
var ObjProto = ObjClass[PROTOTYPE]; | ||
var _cachedGlobal = null; | ||
/** | ||
* 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(useCached) { | ||
if (useCached === void 0) { useCached = true; } | ||
var result = useCached === false ? null : _cachedGlobal; | ||
if (!result) { | ||
if (typeof globalThis !== strShimUndefined) { | ||
result = globalThis; | ||
} | ||
if (!result && typeof self !== strShimUndefined) { | ||
result = self; | ||
} | ||
if (!result && typeof window !== strShimUndefined) { | ||
result = window; | ||
} | ||
if (!result && typeof global !== strShimUndefined) { | ||
result = global; | ||
} | ||
_cachedGlobal = result; | ||
function _safeGet(cb, defValue) { | ||
var result = defValue; | ||
try { | ||
result = cb(); | ||
} | ||
catch (e) { | ||
} | ||
return result; | ||
} | ||
function _createIs(theType) { | ||
return function (value) { | ||
return typeof value === theType; | ||
}; | ||
} | ||
function _createObjIs(theName) { | ||
var theType = "[object " + theName + "]"; | ||
return function (value) { | ||
return !!(value && objToString(value) === theType); | ||
}; | ||
} | ||
function objToString(value) { | ||
return ObjProto.toString.call(value); | ||
} | ||
var isNumber = _createIs(NUMBER); | ||
var isError = _createObjIs("Error"); | ||
function objHasOwnProperty(obj, prop) { | ||
return obj && ObjProto.hasOwnProperty.call(obj, prop); | ||
} | ||
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); | ||
var objAssign = ObjClass["assign"]; | ||
var GLOBAL_CONFIG_KEY = "__tsUtils$gblCfg"; | ||
var _globalCfg; | ||
function _getGlobalValue() { | ||
var result; | ||
if (typeof globalThis !== UNDEFINED) { | ||
result = globalThis; | ||
} | ||
if (obj == null) { | ||
if (!result && typeof self !== UNDEFINED) { | ||
result = self; | ||
} | ||
if (!result && typeof window !== UNDEFINED) { | ||
result = window; | ||
} | ||
if (!result && typeof global !== UNDEFINED) { | ||
result = global; | ||
} | ||
return result; | ||
} | ||
function _getGlobalConfig() { | ||
if (!_globalCfg) { | ||
var gbl = _getGlobalValue() || {}; | ||
_globalCfg = gbl[GLOBAL_CONFIG_KEY] = gbl[GLOBAL_CONFIG_KEY] || {}; | ||
} | ||
return _globalCfg; | ||
} | ||
function dumpObj(object, format) { | ||
var propertyValueDump = EMPTY; | ||
if (isError(object)) { | ||
propertyValueDump = "{ stack: '" + object.stack + "', message: '" + object.message + "', name: '" + object.name + "'"; | ||
} | ||
else { | ||
try { | ||
propertyValueDump = JSON.stringify(object, null, format ? (isNumber(format) ? format : 4) : UNDEF_VALUE); | ||
} | ||
catch (e) { | ||
propertyValueDump = " - " + dumpObj(e, format); | ||
} | ||
} | ||
return objToString(object) + ": " + propertyValueDump; | ||
} | ||
var objDefineProp = ObjClass["defineProperty"]; | ||
var _globalLazyTestHooks; | ||
var _fetchLazyTestHooks = function () { | ||
_globalLazyTestHooks = _getGlobalConfig(); | ||
_fetchLazyTestHooks = null; | ||
}; | ||
function getLazy(cb) { | ||
var lazyValue = {}; | ||
_fetchLazyTestHooks && _fetchLazyTestHooks(); | ||
lazyValue.b = _globalLazyTestHooks.lzy; | ||
objDefineProp(lazyValue, "v", { | ||
configurable: true, | ||
get: function () { | ||
var result = cb(); | ||
if (!_globalLazyTestHooks.lzy) { | ||
objDefineProp(lazyValue, "v", { | ||
value: result | ||
}); | ||
if (lazyValue.b) { | ||
delete lazyValue.b; | ||
} | ||
} | ||
if (_globalLazyTestHooks.lzy && lazyValue.b !== _globalLazyTestHooks.lzy) { | ||
lazyValue.b = _globalLazyTestHooks.lzy; | ||
} | ||
return result; | ||
} | ||
}); | ||
return lazyValue; | ||
} | ||
function _lazySafeGet(cb, defValue) { | ||
return getLazy(function () { return _safeGet(cb, defValue); }); | ||
} | ||
var _cachedGlobal; | ||
function getGlobal(useCached) { | ||
(!_cachedGlobal || useCached === false || (_globalLazyTestHooks.lzy && !_cachedGlobal.b)) && (_cachedGlobal = _lazySafeGet(_getGlobalValue, null)); | ||
return _cachedGlobal.v; | ||
} | ||
var _objCreate = ObjClass["create"]; | ||
var objCreate = _objCreate || polyObjCreate; | ||
function polyObjCreate(obj) { | ||
if (!obj) { | ||
return {}; | ||
} | ||
var type = typeof obj; | ||
if (type !== strShimObject && type !== strShimFunction) { | ||
throwTypeError("Object prototype may only be an Object:" + obj); | ||
if (type !== OBJECT && type !== FUNCTION) { | ||
throw new TypeError("Prototype must be an Object or function: " + dumpObj(obj)); | ||
} | ||
function tmpFunc() { } | ||
tmpFunc[strShimPrototype] = obj; | ||
return new tmpFunc(); | ||
function tempFunc() { } | ||
tempFunc[PROTOTYPE] = obj; | ||
return new tempFunc(); | ||
} | ||
// 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"]; | ||
@@ -98,8 +173,8 @@ var ReflectObj = (getGlobal() || {})["Reflect"]; | ||
var strIterator = "iterator"; | ||
var strHasOwnProperty = "hasOwnProperty"; | ||
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)) { | ||
if (ObjProto$1[strHasOwnProperty].call(s, p)) { | ||
t[p] = s[p]; | ||
@@ -111,14 +186,11 @@ } | ||
}; | ||
var __assignFn = ObjAssign || __objAssignFnImpl; | ||
// tslint:disable-next-line: only-arrow-functions | ||
var __assignFn = objAssign || __objAssignFnImpl; | ||
var extendStaticsFn = function (d, b) { | ||
extendStaticsFn = ObjClass["setPrototypeOf"] || | ||
// tslint:disable-next-line: only-arrow-functions | ||
extendStaticsFn = ObjClass$1["setPrototypeOf"] || | ||
({ __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)) { | ||
if (b[strHasOwnProperty](p)) { | ||
d[p] = b[p]; | ||
@@ -138,4 +210,3 @@ } | ||
} | ||
// tslint:disable-next-line: ban-comma-operator | ||
d[strShimPrototype] = b === null ? objCreateFn(b) : (__[strShimPrototype] = b[strShimPrototype], new __()); | ||
d[strShimPrototype] = b === null ? objCreate(b) : (__[strShimPrototype] = b[strShimPrototype], new __()); | ||
} | ||
@@ -145,9 +216,9 @@ function __restFn(s, e) { | ||
for (var k in s) { | ||
if (ObjHasOwnProperty.call(s, k) && e.indexOf(k) < 0) { | ||
if (objHasOwnProperty(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])) { | ||
if (s != null && typeof ObjClass$1[strGetOwnPropertySymbols] === strShimFunction) { | ||
for (var i = 0, p = ObjClass$1[strGetOwnPropertySymbols](s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && ObjProto$1["propertyIsEnumerable"].call(s, p[i])) { | ||
t[p[i]] = s[p[i]]; | ||
@@ -160,3 +231,3 @@ } | ||
function __decorateFn(decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = ObjClass["getOwnPropertyDescriptor"](target, key) : desc, d; | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = ObjClass$1["getOwnPropertyDescriptor"](target, key) : desc, d; | ||
if (__hasReflect && typeof ReflectObj[strDecorate] === strShimFunction) { | ||
@@ -167,3 +238,2 @@ r = ReflectObj[strDecorate](decorators, target, key, desc); | ||
for (var i = decorators.length - 1; i >= 0; i--) { | ||
// eslint-disable-next-line no-cond-assign | ||
if (d = decorators[i]) { | ||
@@ -174,4 +244,3 @@ 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; | ||
return c > 3 && r && objDefineProp(target, key, r), r; | ||
} | ||
@@ -190,3 +259,3 @@ function __paramFn(paramIndex, decorator) { | ||
for (var p in m) { | ||
if (p !== strDefault && !ObjHasOwnProperty.call(o, p)) { | ||
if (p !== strDefault && !objHasOwnProperty(o, p)) { | ||
__createBindingFn(o, m, p); | ||
@@ -200,4 +269,4 @@ } | ||
} | ||
if (!!ObjCreate) { | ||
ObjDefineProperty(o, k2, { | ||
if (!!objDefineProp) { | ||
objDefineProp(o, k2, { | ||
enumerable: true, | ||
@@ -248,3 +317,2 @@ get: function () { | ||
try { | ||
// tslint:disable-next-line:no-conditional-assignment | ||
if (r && !r.done && (m = i["return"])) { | ||
@@ -256,3 +324,2 @@ m.call(i); | ||
if (e) { | ||
// eslint-disable-next-line no-unsafe-finally | ||
throw e.error; | ||
@@ -264,10 +331,7 @@ } | ||
} | ||
/** @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++) { | ||
@@ -287,4 +351,4 @@ for (var a = theArgs[i], j = 0, jl = a.length; j < jl; j++, k++) { | ||
function __makeTemplateObjectFn(cooked, raw) { | ||
if (ObjDefineProperty) { | ||
ObjDefineProperty(cooked, "raw", { value: raw }); | ||
if (objDefineProp) { | ||
objDefineProp(cooked, "raw", { value: raw }); | ||
} | ||
@@ -308,5 +372,4 @@ else { | ||
} | ||
// Set default module | ||
if (!!ObjCreate) { | ||
ObjDefineProperty(result, strDefault, { enumerable: true, value: mod }); | ||
if (!!objDefineProp) { | ||
objDefineProp(result, strDefault, { enumerable: true, value: mod }); | ||
} | ||
@@ -324,8 +387,5 @@ else { | ||
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; | ||
root.__assign = objAssign || assignFn; | ||
} | ||
@@ -339,3 +399,2 @@ if (!root.__extends) { | ||
})(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) { | ||
@@ -352,8 +411,6 @@ __assign = globalObj.__assign; | ||
exports.ObjAssign = ObjAssign; | ||
exports.ObjClass = ObjClass; | ||
exports.ObjCreate = ObjCreate; | ||
exports.ObjDefineProperty = ObjDefineProperty; | ||
exports.ObjHasOwnProperty = ObjHasOwnProperty; | ||
exports.ObjProto = ObjProto; | ||
exports.ObjAssign = objAssign; | ||
exports.ObjClass = ObjClass$1; | ||
exports.ObjDefineProperty = objDefineProp; | ||
exports.ObjProto = ObjProto$1; | ||
exports.__assignFn = __assignFn; | ||
@@ -376,6 +433,4 @@ exports.__createBindingFn = __createBindingFn; | ||
exports.getGlobal = getGlobal; | ||
exports.objCreateFn = objCreateFn; | ||
exports.strDefault = strDefault; | ||
exports.strShimFunction = strShimFunction; | ||
exports.strShimHasOwnProperty = strShimHasOwnProperty; | ||
exports.strShimObject = strShimObject; | ||
@@ -386,4 +441,2 @@ exports.strShimPrototype = strShimPrototype; | ||
(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 }); | ||
})); |
/*! | ||
* Microsoft Application Insights JavaScript SDK - Shim functions, 2.0.2 | ||
* Microsoft Application Insights JavaScript SDK - Shim functions, 3.0.0 | ||
* Copyright (c) Microsoft and contributors. All rights reserved. | ||
*/ | ||
var e=this,n=function(e){"use strict";var l="function",r="object",n="undefined",o="prototype",i="hasOwnProperty",a="default",u=Object,f=u[o],s=u.assign,c=u.create,_=u.defineProperty,p=f[i],t=null;function d(e){e=!1===(e=void 0===e||e)?null:t;return e||((e=(e=(e=typeof globalThis!=n?globalThis:e)||typeof self==n?e:self)||typeof window==n?e:window)||typeof global==n||(e=global),t=e),e}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!==l&&y("Object prototype may only be an Object:"+e),t[o]=e,new t}var v=(d()||{}).Symbol,b=(d()||{}).Reflect,h=!!b,m="decorate",O="metadata",w="getOwnPropertySymbols",j="iterator",F=s||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])f[i].call(n,o)&&(e[o]=n[o]);return e},x=function(e,n){return(x=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 P(e,n){function t(){this.constructor=e}typeof n!==l&&null!==n&&y("Class extends value "+n+" is not a constructor or null"),x(e,n),e[o]=null===n?g(n):(t[o]=n[o],new t)}function S(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=f,e.__assignFn=F,e.__createBindingFn=S,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(h&&typeof b[m]===l)a=b[m](e,n,t,r);else for(var f=e.length-1;0<=f;f--)(o=e[f])&&(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)||S(n,e,t)},e.__exposeGlobalTsLib=function(){var e,n=d()||{},t=P,r=S;(e=n).__assign||(e.__assign=s||F),e.__extends||(e.__extends=t),e.__createBinding||(e.__createBinding=r),__assign=__assign||n.__assign,__extends=__extends||n.__extends,__createBinding=__createBinding||n.__createBinding},e.__extendsFn=P,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)&&S(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(h&&b[O]===l)return b[O](e,n)},e.__paramFn=function(t,r){return function(e,n){r(e,n,t)}},e.__readFn=function(e,n){var t=typeof v===l&&e[v[j]];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(f){o={error:f}}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[w]===l)for(var o=0,i=u[w](e);o<i.length;o++)!~n.indexOf(i[o])&&f.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],f=0,l=a.length;f<l;f++,i++)o[i]=a[f];return o},e.__valuesFn=function(e){var n=typeof v===l&&v[j],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=l,e.strShimHasOwnProperty=i,e.strShimObject=r,e.strShimPrototype=o,e.strShimUndefined=n,e.throwTypeError=y;var A="__esModule",M={value:!0},T=Object.defineProperty;if(T)try{return void T(e,A,M)}catch(B){}typeof M.value!==undefined&&(e[A]=M.value)};"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={})); | ||
var n=this,e=function(n){"use strict";var l="function",r="prototype",o="default",u=Object,a=u[r],i=undefined,f="prototype",e="undefined",t=Object,s=t[f];function c(n){return s.toString.call(n)}function _(n,e){return n&&s.hasOwnProperty.call(n,e)}function p(n){throw new TypeError(n)}var d,y=t.assign,g="__tsUtils$gblCfg";function v(){var n;return(n=(n=(n=typeof globalThis!==e?globalThis:n)||typeof self===e?n:self)||typeof window===e?n:window)||typeof global===e?n:global}function b(n,e){var t="";if(n&&"[object Error]"===c(n))t="{ stack: '"+n.stack+"', message: '"+n.message+"', name: '"+n.name+"'";else try{t=JSON.stringify(n,null,e?"number"==typeof e?e:4:i)}catch(r){t=" - "+b(r,e)}return c(n)+": "+t}var h,m,O=t.defineProperty,w=function(){var n;d||(n=v()||{},d=n[g]=n[g]||{}),h=d,w=null};function x(n){return(m=!m||!1===n||h.lzy&&!m.b?(r=v,e=function(){var n=r,e=null;try{e=n()}catch(t){}return e},t={},w&&w(),t.b=h.lzy,O(t,"v",{configurable:!0,get:function(){var n=e();return h.lzy||(O(t,"v",{value:n}),t.b&&delete t.b),h.lzy&&t.b!==h.lzy&&(t.b=h.lzy),n}}),t):m).v;var r,e,t}var k=t.create||function(n){if(!n)return{};var e=typeof n;if("object"==e||"function"==e)return t[f]=n,new t;function t(){}throw new TypeError("Prototype must be an Object or function: "+b(n))},F=(x()||{}).Symbol,j=(x()||{}).Reflect,S=!!j,P="decorate",T="metadata",A="getOwnPropertySymbols",M="iterator",z="hasOwnProperty",B=y||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var o in e=arguments[t])a[z].call(e,o)&&(n[o]=e[o]);return n},D=function(n,e){return(D=u.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var t in e)e[z](t)&&(n[t]=e[t])})(n,e)};function E(n,e){function t(){this.constructor=n}typeof e!=l&&null!==e&&p("Class extends value "+e+" is not a constructor or null"),D(n,e),n[r]=null===e?k(e):(t[r]=e[r],new t)}function I(n,e,t,r){r===undefined&&(r=t),O?O(n,r,{enumerable:!0,get:function(){return e[t]}}):n[r]=e[t]}n.ObjAssign=y,n.ObjClass=u,n.ObjDefineProperty=O,n.ObjProto=a,n.__assignFn=B,n.__createBindingFn=I,n.__decorateFn=function(n,e,t,r){var o,i=arguments.length,a=i<3?e:null===r?r=u.getOwnPropertyDescriptor(e,t):r;if(S&&typeof j[P]==l)a=j[P](n,e,t,r);else for(var f=n.length-1;0<=f;f--)(o=n[f])&&(a=(i<3?o(a):3<i?o(e,t,a):o(e,t))||a);return 3<i&&a&&O(e,t,a),a},n.__exportStarFn=function(n,e){for(var t in n)t===o||_(e,t)||I(e,n,t)},n.__exposeGlobalTsLib=function(){var n,e=x()||{},t=E,r=I;(n=e).__assign||(n.__assign=y||B),n.__extends||(n.__extends=t),n.__createBinding||(n.__createBinding=r),__assign=__assign||e.__assign,__extends=__extends||e.__extends,__createBinding=__createBinding||e.__createBinding},n.__extendsFn=E,n.__importDefaultFn=function(n){return n&&n.__esModule?n:{strDefault:n}},n.__importStarFn=function(n){if(n&&n.__esModule)return n;var e={};if(null!=n)for(var t in n)t!==o&&Object.prototype.hasOwnProperty.call(n,t)&&I(e,n,t);return O?O(e,o,{enumerable:!0,value:n}):e[o]=n,e},n.__makeTemplateObjectFn=function(n,e){return O?O(n,"raw",{value:e}):n.raw=e,n},n.__metadataFn=function(n,e){if(S&&j[T]===l)return j[T](n,e)},n.__paramFn=function(t,r){return function(n,e){r(n,e,t)}},n.__readFn=function(n,e){var t=typeof F==l&&n[F[M]];if(!t)return n;var r,o,i=t.call(n),a=[];try{for(;(void 0===e||0<e--)&&!(r=i.next()).done;)a.push(r.value)}catch(f){o={error:f}}finally{try{r&&!r.done&&(t=i["return"])&&t.call(i)}finally{if(o)throw o.error}}return a},n.__restFn=function(n,e){var t,r={};for(t in n)_(n,t)&&!~e.indexOf(t)&&(r[t]=n[t]);if(null!=n&&typeof u[A]==l)for(var o=0,i=u[A](n);o<i.length;o++)!~e.indexOf(i[o])&&a.propertyIsEnumerable.call(n,i[o])&&(r[i[o]]=n[i[o]]);return r},n.__spreadArrayFn=function(n,e){for(var t=0,r=e.length,o=n.length;t<r;t++,o++)n[o]=e[t];return n},n.__spreadArraysFn=function(){for(var n=arguments,e=0,t=0,r=n.length;t<r;t++)e+=n[t].length;for(var o=Array(e),i=0,t=0;t<r;t++)for(var a=n[t],f=0,l=a.length;f<l;f++,i++)o[i]=a[f];return o},n.__valuesFn=function(n){var e=typeof F==l&&F[M],t=e&&n[e],r=0;return t?t.call(n):n&&"number"==typeof n.length?{next:function(){return{value:(n=n&&r>=n.length?void 0:n)&&n[r++],done:!n}}}:void p(e?"Object is not iterable.":"Symbol.iterator is not defined.")},n.getGlobal=x,n.strDefault=o,n.strShimFunction=l,n.strShimObject="object",n.strShimPrototype=r,n.strShimUndefined="undefined",n.throwTypeError=p};"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((n="undefined"!=typeof globalThis?globalThis:n||self).Microsoft=n.Microsoft||{},n.Microsoft.ApplicationInsights=n.Microsoft.ApplicationInsights||{},n.Microsoft.ApplicationInsights.Shims={})); |
{ | ||
"name": "@microsoft/applicationinsights-shims", | ||
"author": "Microsoft Application Insights Team", | ||
"version": "2.0.2", | ||
"version": "3.0.0", | ||
"description": "Microsoft Application Insights JavaScript SDK - Shim functions", | ||
"homepage": "https://github.com/microsoft/ApplicationInsights-JS/tree/master/tools/shims", | ||
"homepage": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/tools/shims", | ||
"keywords": [ | ||
@@ -13,6 +13,6 @@ "azure", | ||
"tslib", | ||
"es3" | ||
"es5" | ||
], | ||
"main": "dist/umd/applicationinsights-shims.js", | ||
"module": "dist-esm/applicationinsights-shims.js", | ||
"main": "dist/es5/umd/applicationinsights-shims.js", | ||
"module": "dist-es5/applicationinsights-shims.js", | ||
"types": "types/applicationinsights-shims.d.ts", | ||
@@ -23,10 +23,11 @@ "scripts": { | ||
"build:esm": "grunt shims", | ||
"build:bundle": "rollup -c rollup.config.js", | ||
"build:bundle": "rollup -c rollup.config.js --bundleConfigAsCjs", | ||
"rebuild": "npm run build", | ||
"test": "grunt shimstest", | ||
"lint": "tslint -p tsconfig.json" | ||
"lint": "tslint -p tsconfig.json", | ||
"npm-pack": "npm pack" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/microsoft/ApplicationInsights-JS/tree/master/tools/shims" | ||
"url": "https://github.com/microsoft/ApplicationInsights-JS/tree/main/tools/shims" | ||
}, | ||
@@ -39,19 +40,23 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@types/qunit": "^2.19.3", | ||
"@microsoft/dynamicproto-js": "^2.0.2", | ||
"@microsoft/ai-test-framework": "0.0.1", | ||
"@microsoft/applicationinsights-rollup-plugin-uglify3-js": "1.0.0", | ||
"@microsoft/applicationinsights-rollup-es3" : "1.1.3", | ||
"@microsoft/applicationinsights-rollup-es5" : "1.0.0", | ||
"grunt": "^1.5.3", | ||
"grunt-cli": "^1.4.3", | ||
"grunt-contrib-qunit": "^5.0.1", | ||
"grunt-contrib-qunit": "^6.2.1", | ||
"@nevware21/grunt-ts-plugin": "^0.4.3", | ||
"@nevware21/grunt-eslint-ts": "^0.2.2", | ||
"@rollup/plugin-commonjs": "^18.0.0", | ||
"@rollup/plugin-node-resolve": "^11.2.1", | ||
"@rollup/plugin-replace": "^2.3.3", | ||
"@rollup/plugin-commonjs": "^24.0.0", | ||
"@rollup/plugin-node-resolve": "^15.0.1", | ||
"@rollup/plugin-replace": "^5.0.2", | ||
"rollup-plugin-minify-es": "^1.1.1", | ||
"rollup": "^2.32.0", | ||
"typescript": "^4.3.4" | ||
"rollup-plugin-cleanup": "^3.2.1", | ||
"rollup": "^3.20.0", | ||
"typescript": "^4.9.3" | ||
}, | ||
"dependencies": { | ||
"@nevware21/ts-utils": ">= 0.9.4 < 2.x" | ||
} | ||
} |
@@ -15,2 +15,6 @@ # Microsoft Application Insights JavaScript SDK - Shims | ||
## ES3 Support removed from v3.x | ||
ES3 support has been removed from the latest version (v3.x) which is also consumed by ApplicationInsights v3.x, if required [see for ES3/IE8 Support](https://microsoft.github.io/ApplicationInsights-JS/es3_Support.html) and you will need to remain on v2.x versions | ||
## Global __extends() and __assign() changes - v2.0.0 or greater | ||
@@ -17,0 +21,0 @@ |
@@ -8,3 +8,3 @@ { | ||
"moduleResolution": "node", | ||
"target": "es3", | ||
"target": "es5", | ||
"forceConsistentCasingInFileNames": true, | ||
@@ -14,8 +14,9 @@ "importHelpers": false, | ||
"alwaysStrict": true, | ||
"suppressImplicitAnyIndexErrors": true, | ||
"allowSyntheticDefaultImports": true, | ||
"declaration": true, | ||
"declarationDir": "tools/shims/types", | ||
"outDir": "./dist-esm", | ||
"rootDir": "tools/shims/src", | ||
"suppressImplicitAnyIndexErrors": true, | ||
"allowSyntheticDefaultImports": true | ||
"declarationDir": "./types", | ||
"outDir": "dist-es5", | ||
"rootDir": "./src", | ||
"removeComments": false | ||
}, | ||
@@ -22,0 +23,0 @@ "include": [ |
@@ -1,4 +0,4 @@ | ||
export { strShimFunction, strShimObject, strShimUndefined, strShimPrototype, strShimHasOwnProperty, strDefault, ObjClass, ObjProto, ObjAssign, ObjCreate, ObjDefineProperty, ObjHasOwnProperty } from "./Constants"; | ||
export { throwTypeError, objCreateFn, getGlobal } from "./Helpers"; | ||
export { strShimFunction, strShimObject, strShimUndefined, strShimPrototype, strDefault, ObjClass, ObjProto } from "./Constants"; | ||
export { __assignFn, __extendsFn, __restFn, __spreadArrayFn, __spreadArraysFn, __decorateFn, __paramFn, __metadataFn, __createBindingFn, __valuesFn, __readFn, __makeTemplateObjectFn, __importDefaultFn, __importStarFn, __exportStarFn } from "./TsLibShims"; | ||
export { __exposeGlobalTsLib } from "./TsLibGlobals"; | ||
export { throwTypeError, getGlobal, objAssign as ObjAssign, objDefineProp as ObjDefineProperty } from "@nevware21/ts-utils"; |
@@ -5,17 +5,4 @@ export declare const strShimFunction = "function"; | ||
export declare const strShimPrototype = "prototype"; | ||
export declare const strShimHasOwnProperty = "hasOwnProperty"; | ||
export declare const strDefault = "default"; | ||
export declare const ObjClass: ObjectConstructor; | ||
export declare const ObjProto: Object; | ||
export declare const ObjAssign: { | ||
<T extends {}, U>(target: T, source: U): T & U; | ||
<T_1 extends {}, U_1, V>(target: T_1, source1: U_1, source2: V): T_1 & U_1 & V; | ||
<T_2 extends {}, U_2, V_1, W>(target: T_2, source1: U_2, source2: V_1, source3: W): T_2 & U_2 & V_1 & W; | ||
(target: object, ...sources: any[]): any; | ||
}; | ||
export declare const ObjCreate: { | ||
(o: object): any; | ||
(o: object, properties: PropertyDescriptorMap & ThisType<any>): any; | ||
}; | ||
export declare const ObjDefineProperty: <T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>) => T; | ||
export declare const ObjHasOwnProperty: (v: PropertyKey) => boolean; |
export declare const SymbolObj: any; | ||
export declare const ReflectObj: any; | ||
export declare const __hasSymbol: boolean; | ||
export declare const __hasReflect: boolean; | ||
@@ -5,0 +4,0 @@ export declare type ObjAssignFunc = (t: any, ...sources: any[]) => any; |
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
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
1927
63
102491
1
17
23
1
+ Added@nevware21/ts-utils@0.11.4(transitive)