Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

systemjs

Package Overview
Dependencies
Maintainers
1
Versions
236
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

systemjs - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

4

CHANGELOG.md

@@ -0,1 +1,5 @@

SystemJS 4.0.1 (2019/07/06)
* Fix IE11 regression related to loading json files (https://github.com/systemjs/systemjs/pull/1963, @joeldenning)
* Fix bug where System.import() rejected incorrectly, due to unrelated errors (https://github.com/systemjs/systemjs/pull/1963)
SystemJS 4.0.0 (2019/06/29)

@@ -2,0 +6,0 @@ * Support `<base href>` setting baseURL (https://github.com/systemjs/systemjs/pull/1957, @LarsDenBakker)

25

dist/s.js
/*
* SJS 4.0.0
* SJS 4.0.1
* Minimal SystemJS Build

@@ -367,8 +367,2 @@ */

let err;
if (typeof window !== 'undefined')
window.addEventListener('error', function (e) {
err = e.error;
});
const systemRegister = systemJSPrototype.register;

@@ -382,3 +376,3 @@ systemJSPrototype.register = function (deps, declare) {

const loader = this;
if (url.endsWith('.json')) {
if (url.substr(-5) === '.json') {
return fetch(url).then(function (resp) {

@@ -393,2 +387,11 @@ return resp.text();

return new Promise(function (resolve, reject) {
let err;
function windowErrorListener(evt) {
if (evt.filename === url)
err = evt.error;
}
window.addEventListener('error', windowErrorListener);
const script = document.createElement('script');

@@ -399,10 +402,12 @@ script.charset = 'utf-8';

script.addEventListener('error', function () {
window.removeEventListener('error', windowErrorListener);
reject(Error('Error loading ' + url + (firstParentUrl ? ' from ' + firstParentUrl : '')));
});
script.addEventListener('load', function () {
window.removeEventListener('error', windowErrorListener);
document.head.removeChild(script);
// Note URL normalization issues are going to be a careful concern here
// Note that if an error occurs that isn't caught by this if statement,
// that getRegister will return null and a "did not instantiate" error will be thrown.
if (err) {
reject(err);
return err = undefined;
}

@@ -409,0 +414,0 @@ else {

@@ -1,1 +0,1 @@

!function(){const e="undefined"!=typeof self,n=e?self:global;let t;if("undefined"!=typeof document){const e=document.querySelector("base[href]");e&&(t=e.href)}if(!t&&"undefined"!=typeof location){const e=(t=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==e&&(t=t.slice(0,e+1))}const r=/\\/g,o="undefined"!=typeof Symbol,i=o&&Symbol.toStringTag,c=o?Symbol():"@";function u(){this[c]={}}const s=u.prototype;let l;s.import=function(e,n){const t=this;return Promise.resolve(t.resolve(e,n)).then(function(e){const n=function e(n,t,r){let o=n[c][t];if(o)return o;const u=[],s=Object.create(null);i&&Object.defineProperty(s,i,{value:"Module"});let l=Promise.resolve().then(function(){return n.instantiate(t,r)}).then(function(e){if(!e)throw Error("Module "+t+" did not instantiate");const r=e[1](function(e,n){o.h=!0;let t=!1;if("object"!=typeof e)e in s&&s[e]===n||(s[e]=n,t=!0);else for(let n in e){let r=e[n];n in s&&s[n]===r||(s[n]=r,t=!0)}if(t)for(let e=0;e<u.length;e++)u[e](s);return n},2===e[1].length?{import:function(e){return n.import(e,t)},meta:n.createContext(t)}:void 0);return o.e=r.execute||function(){},[e[0],r.setters||[]]});const f=l.then(function(r){return Promise.all(r[0].map(function(o,i){const c=r[1][i];return Promise.resolve(n.resolve(o,t)).then(function(r){const o=e(n,r,t);return Promise.resolve(o.I).then(function(){return c&&(o.i.push(c),!o.h&&o.I||c(o.n)),o})})})).then(function(e){o.d=e})});return f.catch(function(e){o.e=null,o.er=e}),o=n[c][t]={id:t,i:u,n:s,I:l,L:f,h:!1,d:void 0,e:void 0,er:void 0,E:void 0,C:void 0}}(t,e);return n.C||function(e,n){return n.C=function e(n,t,r){if(!r[t.id])return r[t.id]=!0,Promise.resolve(t.L).then(function(){return Promise.all(t.d.map(function(t){return e(n,t,r)}))})}(e,n,{}).then(function(){return function e(n,t,r){if(r[t.id])return;if(r[t.id]=!0,!t.e){if(t.er)throw t.er;return t.E?t.E:void 0}let o;return t.d.forEach(function(t){{const i=e(n,t,r);i&&(o=o||[]).push(i)}}),o?Promise.all(o).then(i):i();function i(){try{let e=t.e.call(f);if(e)return e=e.then(function(){t.C=t.n,t.E=null}),t.E=t.E||e;t.C=t.n}catch(e){throw t.er=e,e}finally{t.L=t.I=void 0,t.e=null}}}(e,n,{})}).then(function(){return n.n})}(t,n)})},s.createContext=function(e){return{url:e}},s.register=function(e,n){l=[e,n]},s.getRegister=function(){const e=l;return l=void 0,e};const f=Object.freeze(Object.create(null));let d;n.System=new u,"undefined"!=typeof window&&window.addEventListener("error",function(e){d=e.error});const h=s.register;s.register=function(e,n){d=void 0,h.call(this,e,n)},s.instantiate=function(e,n){const t=this;return e.endsWith(".json")?fetch(e).then(function(e){return e.text()}).then(function(e){return[[],function(n){return{execute:function(){n("default",JSON.parse(e))}}}]}):new Promise(function(r,o){const i=document.createElement("script");i.charset="utf-8",i.async=!0,i.crossOrigin="anonymous",i.addEventListener("error",function(){o(Error("Error loading "+e+(n?" from "+n:"")))}),i.addEventListener("load",function(){if(document.head.removeChild(i),d)return o(d),d=void 0;r(t.getRegister())}),i.src=e,document.head.appendChild(i)})},e&&"function"==typeof importScripts&&(s.instantiate=function(e){const n=this;return new Promise(function(t,r){try{importScripts(e)}catch(e){r(e)}t(n.getRegister())})}),s.resolve=function(e,n){const o=function(e,n){if(-1!==e.indexOf("\\")&&(e=e.replace(r,"/")),"/"===e[0]&&"/"===e[1])return n.slice(0,n.indexOf(":")+1)+e;if("."===e[0]&&("/"===e[1]||"."===e[1]&&("/"===e[2]||2===e.length&&(e+="/"))||1===e.length&&(e+="/"))||"/"===e[0]){const t=n.slice(0,n.indexOf(":")+1);let r;if(r="/"===n[t.length+1]?"file:"!==t?(r=n.slice(t.length+2)).slice(r.indexOf("/")+1):n.slice(8):n.slice(t.length+("/"===n[t.length])),"/"===e[0])return n.slice(0,n.length-r.length-1)+e;const o=r.slice(0,r.lastIndexOf("/")+1)+e,i=[];let c=-1;for(let e=0;e<o.length;e++)-1!==c?"/"===o[e]&&(i.push(o.slice(c,e+1)),c=-1):"."===o[e]?"."!==o[e+1]||"/"!==o[e+2]&&e+2!==o.length?"/"===o[e+1]||e+1===o.length?e+=1:c=e:(i.pop(),e+=2):c=e;return-1!==c&&i.push(o.slice(c)),n.slice(0,n.length-r.length)+i.join("")}}(e,n||t);if(!o){if(-1!==e.indexOf(":"))return Promise.resolve(e);throw Error('Cannot resolve "'+e+(n?'" from '+n:'"'))}return Promise.resolve(o)}}();
!function(){const e="undefined"!=typeof self,n=e?self:global;let t;if("undefined"!=typeof document){const e=document.querySelector("base[href]");e&&(t=e.href)}if(!t&&"undefined"!=typeof location){const e=(t=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==e&&(t=t.slice(0,e+1))}const r=/\\/g,o="undefined"!=typeof Symbol,i=o&&Symbol.toStringTag,c=o?Symbol():"@";function u(){this[c]={}}const s=u.prototype;let l;s.import=function(e,n){const t=this;return Promise.resolve(t.resolve(e,n)).then(function(e){const n=function e(n,t,r){let o=n[c][t];if(o)return o;const u=[],s=Object.create(null);i&&Object.defineProperty(s,i,{value:"Module"});let l=Promise.resolve().then(function(){return n.instantiate(t,r)}).then(function(e){if(!e)throw Error("Module "+t+" did not instantiate");const r=e[1](function(e,n){o.h=!0;let t=!1;if("object"!=typeof e)e in s&&s[e]===n||(s[e]=n,t=!0);else for(let n in e){let r=e[n];n in s&&s[n]===r||(s[n]=r,t=!0)}if(t)for(let e=0;e<u.length;e++)u[e](s);return n},2===e[1].length?{import:function(e){return n.import(e,t)},meta:n.createContext(t)}:void 0);return o.e=r.execute||function(){},[e[0],r.setters||[]]});const f=l.then(function(r){return Promise.all(r[0].map(function(o,i){const c=r[1][i];return Promise.resolve(n.resolve(o,t)).then(function(r){const o=e(n,r,t);return Promise.resolve(o.I).then(function(){return c&&(o.i.push(c),!o.h&&o.I||c(o.n)),o})})})).then(function(e){o.d=e})});return f.catch(function(e){o.e=null,o.er=e}),o=n[c][t]={id:t,i:u,n:s,I:l,L:f,h:!1,d:void 0,e:void 0,er:void 0,E:void 0,C:void 0}}(t,e);return n.C||function(e,n){return n.C=function e(n,t,r){if(!r[t.id])return r[t.id]=!0,Promise.resolve(t.L).then(function(){return Promise.all(t.d.map(function(t){return e(n,t,r)}))})}(e,n,{}).then(function(){return function e(n,t,r){if(r[t.id])return;if(r[t.id]=!0,!t.e){if(t.er)throw t.er;return t.E?t.E:void 0}let o;return t.d.forEach(function(t){{const i=e(n,t,r);i&&(o=o||[]).push(i)}}),o?Promise.all(o).then(i):i();function i(){try{let e=t.e.call(f);if(e)return e=e.then(function(){t.C=t.n,t.E=null}),t.E=t.E||e;t.C=t.n}catch(e){throw t.er=e,e}finally{t.L=t.I=void 0,t.e=null}}}(e,n,{})}).then(function(){return n.n})}(t,n)})},s.createContext=function(e){return{url:e}},s.register=function(e,n){l=[e,n]},s.getRegister=function(){const e=l;return l=void 0,e};const f=Object.freeze(Object.create(null));n.System=new u;const d=s.register;s.register=function(e,n){err=void 0,d.call(this,e,n)},s.instantiate=function(e,n){const t=this;return".json"===e.substr(-5)?fetch(e).then(function(e){return e.text()}).then(function(e){return[[],function(n){return{execute:function(){n("default",JSON.parse(e))}}}]}):new Promise(function(r,o){let i;function c(n){n.filename===e&&(i=n.error)}window.addEventListener("error",c);const u=document.createElement("script");u.charset="utf-8",u.async=!0,u.crossOrigin="anonymous",u.addEventListener("error",function(){window.removeEventListener("error",c),o(Error("Error loading "+e+(n?" from "+n:"")))}),u.addEventListener("load",function(){window.removeEventListener("error",c),document.head.removeChild(u),i?o(i):r(t.getRegister())}),u.src=e,document.head.appendChild(u)})},e&&"function"==typeof importScripts&&(s.instantiate=function(e){const n=this;return new Promise(function(t,r){try{importScripts(e)}catch(e){r(e)}t(n.getRegister())})}),s.resolve=function(e,n){const o=function(e,n){if(-1!==e.indexOf("\\")&&(e=e.replace(r,"/")),"/"===e[0]&&"/"===e[1])return n.slice(0,n.indexOf(":")+1)+e;if("."===e[0]&&("/"===e[1]||"."===e[1]&&("/"===e[2]||2===e.length&&(e+="/"))||1===e.length&&(e+="/"))||"/"===e[0]){const t=n.slice(0,n.indexOf(":")+1);let r;if(r="/"===n[t.length+1]?"file:"!==t?(r=n.slice(t.length+2)).slice(r.indexOf("/")+1):n.slice(8):n.slice(t.length+("/"===n[t.length])),"/"===e[0])return n.slice(0,n.length-r.length-1)+e;const o=r.slice(0,r.lastIndexOf("/")+1)+e,i=[];let c=-1;for(let e=0;e<o.length;e++)-1!==c?"/"===o[e]&&(i.push(o.slice(c,e+1)),c=-1):"."===o[e]?"."!==o[e+1]||"/"!==o[e+2]&&e+2!==o.length?"/"===o[e+1]||e+1===o.length?e+=1:c=e:(i.pop(),e+=2):c=e;return-1!==c&&i.push(o.slice(c)),n.slice(0,n.length-r.length)+i.join("")}}(e,n||t);if(!o){if(-1!==e.indexOf(":"))return Promise.resolve(e);throw Error('Cannot resolve "'+e+(n?'" from '+n:'"'))}return Promise.resolve(o)}}();
/*
* SystemJS 4.0.0
* SystemJS 4.0.1
*/

@@ -474,8 +474,2 @@ (function () {

let err;
if (typeof window !== 'undefined')
window.addEventListener('error', function (e) {
err = e.error;
});
const systemRegister = systemJSPrototype.register;

@@ -489,3 +483,3 @@ systemJSPrototype.register = function (deps, declare) {

const loader = this;
if (url.endsWith('.json')) {
if (url.substr(-5) === '.json') {
return fetch(url).then(function (resp) {

@@ -500,2 +494,11 @@ return resp.text();

return new Promise(function (resolve, reject) {
let err;
function windowErrorListener(evt) {
if (evt.filename === url)
err = evt.error;
}
window.addEventListener('error', windowErrorListener);
const script = document.createElement('script');

@@ -506,10 +509,12 @@ script.charset = 'utf-8';

script.addEventListener('error', function () {
window.removeEventListener('error', windowErrorListener);
reject(Error('Error loading ' + url + (firstParentUrl ? ' from ' + firstParentUrl : '')));
});
script.addEventListener('load', function () {
window.removeEventListener('error', windowErrorListener);
document.head.removeChild(script);
// Note URL normalization issues are going to be a careful concern here
// Note that if an error occurs that isn't caught by this if statement,
// that getRegister will return null and a "did not instantiate" error will be thrown.
if (err) {
reject(err);
return err = undefined;
}

@@ -516,0 +521,0 @@ else {

/*
* SystemJS 4.0.0
* SystemJS 4.0.1
*/
!function(){const t="undefined"!=typeof self,e=t?self:global;let n;if("undefined"!=typeof document){const t=document.querySelector("base[href]");t&&(n=t.href)}if(!n&&"undefined"!=typeof location){const t=(n=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==t&&(n=n.slice(0,t+1))}const o=/\\/g;function r(t,e){if(-1!==t.indexOf("\\")&&(t=t.replace(o,"/")),"/"===t[0]&&"/"===t[1])return e.slice(0,e.indexOf(":")+1)+t;if("."===t[0]&&("/"===t[1]||"."===t[1]&&("/"===t[2]||2===t.length&&(t+="/"))||1===t.length&&(t+="/"))||"/"===t[0]){const n=e.slice(0,e.indexOf(":")+1);let o;if(o="/"===e[n.length+1]?"file:"!==n?(o=e.slice(n.length+2)).slice(o.indexOf("/")+1):e.slice(8):e.slice(n.length+("/"===e[n.length])),"/"===t[0])return e.slice(0,e.length-o.length-1)+t;const r=o.slice(0,o.lastIndexOf("/")+1)+t,i=[];let c=-1;for(let t=0;t<r.length;t++)-1!==c?"/"===r[t]&&(i.push(r.slice(c,t+1)),c=-1):"."===r[t]?"."!==r[t+1]||"/"!==r[t+2]&&t+2!==r.length?"/"===r[t+1]||t+1===r.length?t+=1:c=t:(i.pop(),t+=2):c=t;return-1!==c&&i.push(r.slice(c)),e.slice(0,e.length-o.length)+i.join("")}}function i(t,e){return r(t,e)||-1!==t.indexOf(":")&&t||r("./"+t,e)}function c(t,e){var n={};for(var o in t){var c=t[o];"string"==typeof c&&(n[r(o,e)||o]=i(c,e))}return n}function s(t,e){if(e[t])return t;let n=t.length;do{const o=t.slice(0,n+1);if(o in e)return o}while(-1!==(n=t.lastIndexOf("/",n-1)))}function u(t,e){const n=s(t,e);if(n){const o=e[n];return null===o&&t.length>n.length&&"/"!==o[o.length-1]&&console.warn("Invalid package target "+o+" for '"+n+"' should have a trailing '/'."),o+t.slice(n.length)}}const l="undefined"!=typeof Symbol,f=l&&Symbol.toStringTag,d=l?Symbol():"@";function a(){this[d]={}}const h=a.prototype;let p;h.import=function(t,e){const n=this;return Promise.resolve(n.resolve(t,e)).then(function(t){const e=function t(e,n,o){let r=e[d][n];if(r)return r;const i=[],c=Object.create(null);f&&Object.defineProperty(c,f,{value:"Module"});let s=Promise.resolve().then(function(){return e.instantiate(n,o)}).then(function(t){if(!t)throw Error("Module "+n+" did not instantiate");const o=t[1](function(t,e){r.h=!0;let n=!1;if("object"!=typeof t)t in c&&c[t]===e||(c[t]=e,n=!0);else for(let e in t){let o=t[e];e in c&&c[e]===o||(c[e]=o,n=!0)}if(n)for(let t=0;t<i.length;t++)i[t](c);return e},2===t[1].length?{import:function(t){return e.import(t,n)},meta:e.createContext(n)}:void 0);return r.e=o.execute||function(){},[t[0],o.setters||[]]});const u=(s=s.catch(function(t){throw e.onload(r.id,t),t})).then(function(o){return Promise.all(o[0].map(function(r,i){const c=o[1][i];return Promise.resolve(e.resolve(r,n)).then(function(o){const r=t(e,o,n);return Promise.resolve(r.I).then(function(){return c&&(r.i.push(c),!r.h&&r.I||c(r.n)),r})})})).then(function(t){r.d=t})});return u.catch(function(t){r.e=null,r.er=t}),r=e[d][n]={id:n,i:i,n:c,I:s,L:u,h:!1,d:void 0,e:void 0,er:void 0,E:void 0,C:void 0}}(n,t);return e.C||function(t,e){return e.C=function t(e,n,o){if(!o[n.id])return o[n.id]=!0,Promise.resolve(n.L).then(function(){return Promise.all(n.d.map(function(n){return t(e,n,o)}))})}(t,e,{}).then(function(){return function t(e,n,o){if(o[n.id])return;if(o[n.id]=!0,!n.e){if(n.er)throw n.er;return n.E?n.E:void 0}let r;return n.d.forEach(function(i){try{const c=t(e,i,o);c&&(r=r||[]).push(c)}catch(t){throw e.onload(n.id,t),t}}),r?Promise.all(r).then(i).catch(function(t){throw e.onload(n.id,t),t}):i();function i(){try{let t=n.e.call(m);if(t)return t=t.then(function(){n.C=n.n,n.E=null,e.onload(n.id,null)},function(t){throw e.onload(n.id,t),t}),n.E=n.E||t;n.C=n.n,e.onload(n.id,null)}catch(t){throw e.onload(n.id,t),n.er=t,t}finally{n.L=n.I=void 0,n.e=null}}}(t,e,{})}).then(function(){return e.n})}(n,e)})},h.createContext=function(t){return{url:t}},h.onload=function(){},h.register=function(t,e){p=[t,e]},h.getRegister=function(){const t=p;return p=void 0,t};const m=Object.freeze(Object.create(null));let g;e.System=new a,"undefined"!=typeof window&&window.addEventListener("error",function(t){g=t.error});const y=h.register;h.register=function(t,e){g=void 0,y.call(this,t,e)},h.instantiate=function(t,e){const n=this;return t.endsWith(".json")?fetch(t).then(function(t){return t.text()}).then(function(t){return[[],function(e){return{execute:function(){e("default",JSON.parse(t))}}}]}):new Promise(function(o,r){const i=document.createElement("script");i.charset="utf-8",i.async=!0,i.crossOrigin="anonymous",i.addEventListener("error",function(){r(Error("Error loading "+t+(e?" from "+e:"")))}),i.addEventListener("load",function(){if(document.head.removeChild(i),g)return r(g),g=void 0;o(n.getRegister())}),i.src=t,document.head.appendChild(i)})},t&&"function"==typeof importScripts&&(h.instantiate=function(t){const e=this;return new Promise(function(n,o){try{importScripts(t)}catch(t){o(t)}n(e.getRegister())})}),function(t){const e=System.constructor.prototype;let n,o,r;const i=e.import;e.import=function(e,c){return function(){n=o=void 0;for(let e in t)t.hasOwnProperty(e)&&(n?o||(o=e):n=e,r=e)}(),i.call(this,e,c)};const c=[[],function(){return{}}],s=e.getRegister;e.getRegister=function(){const e=s.call(this);if(e)return e;const i=function(){let e,i=0;for(let r in t)if(t.hasOwnProperty(r)){if(0===i&&r!==n||1===i&&r!==o)return r;i++,e=r}if(e!==r)return e}();if(!i)return c;let u;try{u=t[i]}catch(t){return c}return[[],function(t){return{execute:function(){t({default:u,__useDefault:!0})}}}]}}("undefined"!=typeof self?self:global);const v=h.instantiate;h.instantiate=function(t,e){return".wasm"!==t.slice(-5)?v.call(this,t,e):fetch(t).then(function(t){if(!t.ok)throw Error(t.status+" "+t.statusText+" "+t.url+(e?" loading from "+e:""));return WebAssembly.compileStreaming?WebAssembly.compileStreaming(t):t.arrayBuffer().then(function(t){return WebAssembly.compile(t)})}).then(function(t){const e=[],n=[],o={};return WebAssembly.Module.imports&&WebAssembly.Module.imports(t).forEach(function(t){const r=t.module;n.push(function(t){o[r]=t}),-1===e.indexOf(r)&&e.push(r)}),[e,function(e){return{setters:n,execute:function(){return WebAssembly.instantiate(t,o).then(function(t){e(t.exports)})}}}]})};const b=Object.create(null);b.imports=Object.create(null),b.scopes=Object.create(null);let O=Promise.resolve(b),E="undefined"!=typeof document;E&&Array.prototype.forEach.call(document.querySelectorAll('script[type="systemjs-importmap"][src]'),function(t){t._j=fetch(t.src).then(function(t){return t.json()})}),h.resolve=function(t,e){return e=e||n,E&&(E=!1,Array.prototype.forEach.call(document.querySelectorAll('script[type="systemjs-importmap"]'),function(t){O=O.then(function(e){return(t._j||t.src&&fetch(t.src).then(function(t){return t.json()})||Promise.resolve(JSON.parse(t.innerHTML))).then(function(o){return function(t,e){for(let n in e.imports)t.imports[n]=e.imports[n];for(let n in e.scopes)t.scopes[n]=e.scopes[n];return t}(e,function(t,e){const n=c(t.imports,e)||{},o={};if(t.scopes)for(let n in t.scopes){const r=t.scopes[n];let s=i(n,e);"/"!==s[s.length-1]&&(s+="/"),o[s]=c(r,s)||{}}return{imports:n,scopes:o}}(o,t.src||n))})})})),O.then(function(n){return function(t,e,n){const o=r(t,e)||-1!==t.indexOf(":")&&t;o&&(t=o);const i=s(e,n.scopes);if(i){const e=u(t,n.scopes[i]);if(e)return e}return u(t,n.imports)||o||function(t,e){throw Error('Unable to resolve bare specifier "'+t+(e?'" from '+e:'"'))}(t,e)}(t,e,n)})};const w="undefined"!=typeof Symbol&&Symbol.toStringTag;h.get=function(t){const e=this[d][t];if(e&&null===e.e&&!e.E)return e.er?null:e.n},h.set=function(t,e){let n;w&&"Module"===e[w]?n=e:(n=Object.assign(Object.create(null),e),w&&Object.defineProperty(n,w,{value:"Module"}));const o=Promise.resolve(n);return this.delete(t),this[d][t]={id:t,i:[],n:n,I:o,L:o,h:!1,d:[],e:null,er:void 0,E:void 0,C:o},n},h.has=function(t){const e=this[d][t];return e&&null===e.e&&!e.E},h.delete=function(t){const e=this.get(t);return void 0!==e&&(e&&e.d&&e.d.forEach(function(t){const n=t.i.indexOf(e);-1!==n&&t.i.splice(n,1)}),delete this[d][t])};const x="undefined"!=typeof Symbol&&Symbol.iterator;h.entries=function(){const t=this,e=Object.keys(t[d]);let n,o,r=0;const i={next:function(){for(;void 0!==(o=e[r++])&&void 0===(n=t.get(o)););return{done:void 0===o,value:void 0!==o&&[o,n]}}};return i[x]=function(){return this},i}}();
!function(){const t="undefined"!=typeof self,e=t?self:global;let n;if("undefined"!=typeof document){const t=document.querySelector("base[href]");t&&(n=t.href)}if(!n&&"undefined"!=typeof location){const t=(n=location.href.split("#")[0].split("?")[0]).lastIndexOf("/");-1!==t&&(n=n.slice(0,t+1))}const o=/\\/g;function r(t,e){if(-1!==t.indexOf("\\")&&(t=t.replace(o,"/")),"/"===t[0]&&"/"===t[1])return e.slice(0,e.indexOf(":")+1)+t;if("."===t[0]&&("/"===t[1]||"."===t[1]&&("/"===t[2]||2===t.length&&(t+="/"))||1===t.length&&(t+="/"))||"/"===t[0]){const n=e.slice(0,e.indexOf(":")+1);let o;if(o="/"===e[n.length+1]?"file:"!==n?(o=e.slice(n.length+2)).slice(o.indexOf("/")+1):e.slice(8):e.slice(n.length+("/"===e[n.length])),"/"===t[0])return e.slice(0,e.length-o.length-1)+t;const r=o.slice(0,o.lastIndexOf("/")+1)+t,i=[];let c=-1;for(let t=0;t<r.length;t++)-1!==c?"/"===r[t]&&(i.push(r.slice(c,t+1)),c=-1):"."===r[t]?"."!==r[t+1]||"/"!==r[t+2]&&t+2!==r.length?"/"===r[t+1]||t+1===r.length?t+=1:c=t:(i.pop(),t+=2):c=t;return-1!==c&&i.push(r.slice(c)),e.slice(0,e.length-o.length)+i.join("")}}function i(t,e){return r(t,e)||-1!==t.indexOf(":")&&t||r("./"+t,e)}function c(t,e){var n={};for(var o in t){var c=t[o];"string"==typeof c&&(n[r(o,e)||o]=i(c,e))}return n}function s(t,e){if(e[t])return t;let n=t.length;do{const o=t.slice(0,n+1);if(o in e)return o}while(-1!==(n=t.lastIndexOf("/",n-1)))}function u(t,e){const n=s(t,e);if(n){const o=e[n];return null===o&&t.length>n.length&&"/"!==o[o.length-1]&&console.warn("Invalid package target "+o+" for '"+n+"' should have a trailing '/'."),o+t.slice(n.length)}}const l="undefined"!=typeof Symbol,f=l&&Symbol.toStringTag,a=l?Symbol():"@";function d(){this[a]={}}const h=d.prototype;let p;h.import=function(t,e){const n=this;return Promise.resolve(n.resolve(t,e)).then(function(t){const e=function t(e,n,o){let r=e[a][n];if(r)return r;const i=[],c=Object.create(null);f&&Object.defineProperty(c,f,{value:"Module"});let s=Promise.resolve().then(function(){return e.instantiate(n,o)}).then(function(t){if(!t)throw Error("Module "+n+" did not instantiate");const o=t[1](function(t,e){r.h=!0;let n=!1;if("object"!=typeof t)t in c&&c[t]===e||(c[t]=e,n=!0);else for(let e in t){let o=t[e];e in c&&c[e]===o||(c[e]=o,n=!0)}if(n)for(let t=0;t<i.length;t++)i[t](c);return e},2===t[1].length?{import:function(t){return e.import(t,n)},meta:e.createContext(n)}:void 0);return r.e=o.execute||function(){},[t[0],o.setters||[]]});const u=(s=s.catch(function(t){throw e.onload(r.id,t),t})).then(function(o){return Promise.all(o[0].map(function(r,i){const c=o[1][i];return Promise.resolve(e.resolve(r,n)).then(function(o){const r=t(e,o,n);return Promise.resolve(r.I).then(function(){return c&&(r.i.push(c),!r.h&&r.I||c(r.n)),r})})})).then(function(t){r.d=t})});return u.catch(function(t){r.e=null,r.er=t}),r=e[a][n]={id:n,i:i,n:c,I:s,L:u,h:!1,d:void 0,e:void 0,er:void 0,E:void 0,C:void 0}}(n,t);return e.C||function(t,e){return e.C=function t(e,n,o){if(!o[n.id])return o[n.id]=!0,Promise.resolve(n.L).then(function(){return Promise.all(n.d.map(function(n){return t(e,n,o)}))})}(t,e,{}).then(function(){return function t(e,n,o){if(o[n.id])return;if(o[n.id]=!0,!n.e){if(n.er)throw n.er;return n.E?n.E:void 0}let r;return n.d.forEach(function(i){try{const c=t(e,i,o);c&&(r=r||[]).push(c)}catch(t){throw e.onload(n.id,t),t}}),r?Promise.all(r).then(i).catch(function(t){throw e.onload(n.id,t),t}):i();function i(){try{let t=n.e.call(m);if(t)return t=t.then(function(){n.C=n.n,n.E=null,e.onload(n.id,null)},function(t){throw e.onload(n.id,t),t}),n.E=n.E||t;n.C=n.n,e.onload(n.id,null)}catch(t){throw e.onload(n.id,t),n.er=t,t}finally{n.L=n.I=void 0,n.e=null}}}(t,e,{})}).then(function(){return e.n})}(n,e)})},h.createContext=function(t){return{url:t}},h.onload=function(){},h.register=function(t,e){p=[t,e]},h.getRegister=function(){const t=p;return p=void 0,t};const m=Object.freeze(Object.create(null));e.System=new d;const g=h.register;h.register=function(t,e){err=void 0,g.call(this,t,e)},h.instantiate=function(t,e){const n=this;return".json"===t.substr(-5)?fetch(t).then(function(t){return t.text()}).then(function(t){return[[],function(e){return{execute:function(){e("default",JSON.parse(t))}}}]}):new Promise(function(o,r){let i;function c(e){e.filename===t&&(i=e.error)}window.addEventListener("error",c);const s=document.createElement("script");s.charset="utf-8",s.async=!0,s.crossOrigin="anonymous",s.addEventListener("error",function(){window.removeEventListener("error",c),r(Error("Error loading "+t+(e?" from "+e:"")))}),s.addEventListener("load",function(){window.removeEventListener("error",c),document.head.removeChild(s),i?r(i):o(n.getRegister())}),s.src=t,document.head.appendChild(s)})},t&&"function"==typeof importScripts&&(h.instantiate=function(t){const e=this;return new Promise(function(n,o){try{importScripts(t)}catch(t){o(t)}n(e.getRegister())})}),function(t){const e=System.constructor.prototype;let n,o,r;const i=e.import;e.import=function(e,c){return function(){n=o=void 0;for(let e in t)t.hasOwnProperty(e)&&(n?o||(o=e):n=e,r=e)}(),i.call(this,e,c)};const c=[[],function(){return{}}],s=e.getRegister;e.getRegister=function(){const e=s.call(this);if(e)return e;const i=function(){let e,i=0;for(let r in t)if(t.hasOwnProperty(r)){if(0===i&&r!==n||1===i&&r!==o)return r;i++,e=r}if(e!==r)return e}();if(!i)return c;let u;try{u=t[i]}catch(t){return c}return[[],function(t){return{execute:function(){t({default:u,__useDefault:!0})}}}]}}("undefined"!=typeof self?self:global);const y=h.instantiate;h.instantiate=function(t,e){return".wasm"!==t.slice(-5)?y.call(this,t,e):fetch(t).then(function(t){if(!t.ok)throw Error(t.status+" "+t.statusText+" "+t.url+(e?" loading from "+e:""));return WebAssembly.compileStreaming?WebAssembly.compileStreaming(t):t.arrayBuffer().then(function(t){return WebAssembly.compile(t)})}).then(function(t){const e=[],n=[],o={};return WebAssembly.Module.imports&&WebAssembly.Module.imports(t).forEach(function(t){const r=t.module;n.push(function(t){o[r]=t}),-1===e.indexOf(r)&&e.push(r)}),[e,function(e){return{setters:n,execute:function(){return WebAssembly.instantiate(t,o).then(function(t){e(t.exports)})}}}]})};const v=Object.create(null);v.imports=Object.create(null),v.scopes=Object.create(null);let b=Promise.resolve(v),O="undefined"!=typeof document;O&&Array.prototype.forEach.call(document.querySelectorAll('script[type="systemjs-importmap"][src]'),function(t){t._j=fetch(t.src).then(function(t){return t.json()})}),h.resolve=function(t,e){return e=e||n,O&&(O=!1,Array.prototype.forEach.call(document.querySelectorAll('script[type="systemjs-importmap"]'),function(t){b=b.then(function(e){return(t._j||t.src&&fetch(t.src).then(function(t){return t.json()})||Promise.resolve(JSON.parse(t.innerHTML))).then(function(o){return function(t,e){for(let n in e.imports)t.imports[n]=e.imports[n];for(let n in e.scopes)t.scopes[n]=e.scopes[n];return t}(e,function(t,e){const n=c(t.imports,e)||{},o={};if(t.scopes)for(let n in t.scopes){const r=t.scopes[n];let s=i(n,e);"/"!==s[s.length-1]&&(s+="/"),o[s]=c(r,s)||{}}return{imports:n,scopes:o}}(o,t.src||n))})})})),b.then(function(n){return function(t,e,n){const o=r(t,e)||-1!==t.indexOf(":")&&t;o&&(t=o);const i=s(e,n.scopes);if(i){const e=u(t,n.scopes[i]);if(e)return e}return u(t,n.imports)||o||function(t,e){throw Error('Unable to resolve bare specifier "'+t+(e?'" from '+e:'"'))}(t,e)}(t,e,n)})};const E="undefined"!=typeof Symbol&&Symbol.toStringTag;h.get=function(t){const e=this[a][t];if(e&&null===e.e&&!e.E)return e.er?null:e.n},h.set=function(t,e){let n;E&&"Module"===e[E]?n=e:(n=Object.assign(Object.create(null),e),E&&Object.defineProperty(n,E,{value:"Module"}));const o=Promise.resolve(n);return this.delete(t),this[a][t]={id:t,i:[],n:n,I:o,L:o,h:!1,d:[],e:null,er:void 0,E:void 0,C:o},n},h.has=function(t){const e=this[a][t];return e&&null===e.e&&!e.E},h.delete=function(t){const e=this.get(t);return void 0!==e&&(e&&e.d&&e.d.forEach(function(t){const n=t.i.indexOf(e);-1!==n&&t.i.splice(n,1)}),delete this[a][t])};const w="undefined"!=typeof Symbol&&Symbol.iterator;h.entries=function(){const t=this,e=Object.keys(t[a]);let n,o,r=0;const i={next:function(){for(;void 0!==(o=e[r++])&&void 0===(n=t.get(o)););return{done:void 0===o,value:void 0!==o&&[o,n]}}};return i[w]=function(){return this},i}}();
{
"name": "systemjs",
"version": "4.0.0",
"version": "4.0.1",
"description": "Dynamic ES module loader",

@@ -5,0 +5,0 @@ "repository": {

@@ -24,3 +24,3 @@ # SystemJS

* Loads and resolves modules as URLs, throwing for bare specifier names (eg `import 'lodash'`) like the native module loader.
* Loads System.register modules.
* Loads System.register and JSON modules.
* Core hookable extensible loader supporting [custom extensions](docs/hooks.md).

@@ -27,0 +27,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc