Socket
Socket
Sign inDemoInstall

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.2 to 4.1.0

dist/extras/use-default.js

10

CHANGELOG.md

@@ -0,3 +1,7 @@

SystemJS 4.1.0 (2019/07/14)
* Added a new "Use Default" extra. (https://github.com/systemjs/systemjs/pull/1969)
* Fix typo in comment. (https://github.com/systemjs/systemjs/pull/1970 @kouts)
SystemJS 4.0.2 (2019/07/08)
* Fix bug thrown in strict mode. (https://github.com/systemjs/systemjs/commit/21933c378d2750e187699c5e7be2aea8eab57833 @joeldenning)
* Fix bug thrown in strict mode. (https://github.com/systemjs/systemjs/pull/1966 @joeldenning)

@@ -8,3 +12,3 @@ SystemJS 4.0.1 (2019/07/06)

SystemJS 4.0.0 (2019/06/29)
**SystemJS 4.0.0 (2019/06/29) - Major Changes**
* Support `<base href>` setting baseURL (https://github.com/systemjs/systemjs/pull/1957, @LarsDenBakker)

@@ -50,3 +54,3 @@ * Use `Error` over `new Error` to reduce footprint (https://github.com/systemjs/systemjs/pull/1951, @joeldenning)

SystemJS 3.0.0 (2019/01/12)
**SystemJS 3.0.0 (2019/01/12) - Major Changes**
* Implement new Import Maps specification replacing Package Name Maps ([#1893](https://github.com/systemjs/systemjs/pull/1893))

@@ -53,0 +57,0 @@

/*
* SJS 4.0.2
* SJS 4.1.0
* Minimal SystemJS Build

@@ -244,3 +244,3 @@ */

// Captial letter = a promise function
// Capital letter = a promise function
return load = loader[REGISTRY][id] = {

@@ -247,0 +247,0 @@ id: id,

/*
* SystemJS 4.0.2
* SystemJS 4.1.0
*/

@@ -334,3 +334,3 @@ (function () {

// Captial letter = a promise function
// Capital letter = a promise function
return load = loader[REGISTRY][id] = {

@@ -337,0 +337,0 @@ id: id,

/*
* SystemJS 4.0.2
* SystemJS 4.1.0
*/
!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){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.2",
"version": "4.1.0",
"description": "Dynamic ES module loader",

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

@@ -45,2 +45,4 @@ # SystemJS

* [Transform loader](dist/extras/transform.js) support, using fetch and eval, supporting a hookable `loader.transform`
* [Use default](dist/extras/use-default.js) provides a convenience interop for AMD modules to return the direct AMD
binding instead of a `{ default: amdModule }` object from `System.import`.

@@ -47,0 +49,0 @@ Since all loader features are hookable, custom extensions can be easily made following the same approach as the bundled extras. See the [hooks documentation](docs/hooks.md) for more information.

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