New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

garden-loader

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

garden-loader - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

tests/fixtures/es6/sub-component.js

46

dist/garden-loader.debug.js

@@ -327,25 +327,31 @@ /**

// Resolve all of the dependencies of the module.
return Promise.all(mod.deps.map(function (dep) {
if (externalRegistry[dep] || /module|exports|require/.test(dep)) {
// The dependency has been externally set so it should be ready.
return Promise.resolve(dep);
} else if (depMod = internalRegistry[dep]) {
if (executed[dep]) {
// The dependency has been loaded and executed and is ready.
var key = name + '!';
if (loading[key]) {
console.log('Waiting for loadDependencies(%s)', name);
return loading[key];
} else {
return loading[key] = Promise.all(mod.deps.map(function (dep) {
if (externalRegistry[dep] || /module|exports|require/.test(dep)) {
// The dependency has been externally set so it should be ready.
return Promise.resolve(dep);
} else {
// Mark as seen to prevent infinite recursion.
executed[dep] = true;
// The dependency hasn't been executed. Check its dependencies.
return loadDependencies(dep).then(function (name) {
executed[dep] = false;
} else if (depMod = internalRegistry[dep]) {
var key = dep + '!'; // add '!' so we can use the same loading var for dependencies too.
if (executed[dep] || loading[key]) {
// The dependencies are being loaded through another process.
return name;
});
} else {
// The dependency hasn't been executed. Check its dependencies.
return loading[key] = loadDependencies(dep).then(function (name) {
loading[key] = Promise.resolve(name);
return name;
});
}
}
}
// Load the dependencies and then recursively load its dependencies.
return load(dep).then(loadDependencies);
})).then(function () {
return name;
});
// Load the dependency and then recursively load its dependencies.
return load(dep).then(loadDependencies);
})).then(function () {
return name;
});
}
}

@@ -352,0 +358,0 @@

@@ -139,7 +139,9 @@ (function(exports) {

var depMod, mod = internalRegistry[name];
if (!mod) return Promise.reject(new Error("Module " + name + " not loaded")); else return Promise.all(mod.deps.map(function(dep) {
if (externalRegistry[dep] || /module|exports|require/.test(dep)) return Promise.resolve(dep); else if (depMod = internalRegistry[dep]) if (executed[dep]) return Promise.resolve(dep); else {
executed[dep] = true;
return loadDependencies(dep).then(function(name) {
executed[dep] = false;
if (!mod) return Promise.reject(new Error("Module " + name + " not loaded"));
var key = name + "!";
if (loading[key]) return loading[key]; else return loading[key] = Promise.all(mod.deps.map(function(dep) {
if (externalRegistry[dep] || /module|exports|require/.test(dep)) return Promise.resolve(dep); else if (depMod = internalRegistry[dep]) {
var key = dep + "!";
if (executed[dep] || loading[key]) return name; else return loading[key] = loadDependencies(dep).then(function(name) {
loading[key] = Promise.resolve(name);
return name;

@@ -146,0 +148,0 @@ });

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

!function(a){"use strict";function b(a,b){if("/"===a.charAt(0)&&(a=a.slice(1)),"."!==a.charAt(0))return a;for(var c=a.split("/");"."===c[0]||".."===c[0];)".."===c.shift()&&b.pop();return b.concat(c).join("/")}function c(a){var b=q[a];return b&&!p[a]&&(p[a]=!0,b.execute()),b&&b.exports}function d(a,b){"object"!=typeof b&&(b={"default":b}),r[a]=b}function e(a){return r[a]||c(a)}function f(a){return!!r[a]||!!q[a]}function g(a,b){var c=[a];c.push.apply(c,b),s.push(c)}function h(a,c,d){if(Array.isArray(a))return void g(h,arguments);var f,i,j=Object.create(null);q[a]=f={exports:j,deps:c.map(function(c){return b(c,a.split("/").slice(0,-1))}),dependants:[],update:function(a,b){i.setters[f.deps.indexOf(a)](b)},execute:function(){f.deps.map(function(b){var c=r[b];c?f.update(b,c):(c=e(b)&&q[b].exports,c&&(q[b].dependants.push(a),f.update(b,c)))}),i.execute()}},i=d(function(b,c){return j[b]=c,f.lock=!0,f.dependants.forEach(function(b){q[b]&&!q[b].lock&&q[b].update(a,j)}),f.lock=!1,c})}function i(a,c,d){if(Array.isArray(a)||"function"==typeof a)return void g(i,arguments);"function"==typeof c&&(d=c,c=[]);var f,h={};q[a]=f={exports:h,deps:c.map(function(c){return b(c,a.split("/").slice(0,-1))}),dependants:[],update:function(a,b){},execute:function(){var b=[];f.deps.map(function(a){var c;"exports"===a?c=f.exports:"module"===a?c=f:(c=r[a],c||(c=e(a)&&q[a].exports,c=c&&c["default"])),b.push(c)});var c=d.apply(null,b);"object"!=typeof f.exports&&(f.exports={"default":f.exports}),"object"==typeof c?(c["default"]=c["default"]||c,f.exports=h=c):c&&(h["default"]=c),f.lock=!0,f.dependants.forEach(function(b){q[b]&&!q[b].lock&&q[b].update(a,h)}),f.lock=!1}}}function j(a,b){var c=document.createElement("script");c.async&&(c.async=!1),c.addEventListener("load",b,!1),c.src=a,n.appendChild(c)}function k(a){return o[a]||(o[a]=new Promise(function(b,c){j((t.baseURL||"")+"/"+a+".js",function(){if(delete o[a],s.length){var d=s.shift();d[0].call(this,a,d[1],d[2])}q[a]?b(a):c(new Error("Error loading module "+a))})})),o[a]}function l(a){var b,c=q[a];return c?Promise.all(c.deps.map(function(a){return r[a]||/module|exports|require/.test(a)?Promise.resolve(a):(b=q[a])?p[a]?Promise.resolve(a):(p[a]=!0,l(a).then(function(b){return p[a]=!1,b})):k(a).then(l)})).then(function(){return a}):Promise.reject(new Error("Module "+a+" not loaded"))}function m(a){var d,e=b(a,[]);return(d=r[e])?Promise.resolve(d):(d=q[e])?p[e]?Promise.resolve(d.exports):l(e).then(c):k(e).then(l).then(c)}var n=document.getElementsByTagName("head")[0],o=Object.create(null),p=Object.create(null),q=Object.create(null),r=Object.create(null),s=[];i.amd={jQuery:!0};var t={set:d,get:e,has:f,"import":m,importAll:function(a){Array.isArray(a)||(a=[].slice.call(arguments));var b=[];return Promise.all(a.map(function(a){var c=/^(.+?)(\.([\w*]+))?$/.exec(a);return a=c[1],b.push(c[3]||"default"),m(a)})).then(function(a){return a.map(function(a,c){return"*"==b[c]?a:a[b[c]]})})},register:h,amdDefine:i,amdRequire:function(a,b){t.importAll(a).spread(b)}};a.System=t,a.define=i,Promise.prototype.spread||(Promise.prototype.spread=function(a){return this.then(function(a){return Promise.all(a)}).then(function(b){return a.apply(this,b)})})}(window);
!function(a){"use strict";function b(a,b){if("/"===a.charAt(0)&&(a=a.slice(1)),"."!==a.charAt(0))return a;for(var c=a.split("/");"."===c[0]||".."===c[0];)".."===c.shift()&&b.pop();return b.concat(c).join("/")}function c(a){var b=q[a];return b&&!p[a]&&(p[a]=!0,b.execute()),b&&b.exports}function d(a,b){"object"!=typeof b&&(b={"default":b}),r[a]=b}function e(a){return r[a]||c(a)}function f(a){return!!r[a]||!!q[a]}function g(a,b){var c=[a];c.push.apply(c,b),s.push(c)}function h(a,c,d){if(Array.isArray(a))return void g(h,arguments);var f,i,j=Object.create(null);q[a]=f={exports:j,deps:c.map(function(c){return b(c,a.split("/").slice(0,-1))}),dependants:[],update:function(a,b){i.setters[f.deps.indexOf(a)](b)},execute:function(){f.deps.map(function(b){var c=r[b];c?f.update(b,c):(c=e(b)&&q[b].exports,c&&(q[b].dependants.push(a),f.update(b,c)))}),i.execute()}},i=d(function(b,c){return j[b]=c,f.lock=!0,f.dependants.forEach(function(b){q[b]&&!q[b].lock&&q[b].update(a,j)}),f.lock=!1,c})}function i(a,c,d){if(Array.isArray(a)||"function"==typeof a)return void g(i,arguments);"function"==typeof c&&(d=c,c=[]);var f,h={};q[a]=f={exports:h,deps:c.map(function(c){return b(c,a.split("/").slice(0,-1))}),dependants:[],update:function(a,b){},execute:function(){var b=[];f.deps.map(function(a){var c;"exports"===a?c=f.exports:"module"===a?c=f:(c=r[a],c||(c=e(a)&&q[a].exports,c=c&&c["default"])),b.push(c)});var c=d.apply(null,b);"object"!=typeof f.exports&&(f.exports={"default":f.exports}),"object"==typeof c?(c["default"]=c["default"]||c,f.exports=h=c):c&&(h["default"]=c),f.lock=!0,f.dependants.forEach(function(b){q[b]&&!q[b].lock&&q[b].update(a,h)}),f.lock=!1}}}function j(a,b){var c=document.createElement("script");c.async&&(c.async=!1),c.addEventListener("load",b,!1),c.src=a,n.appendChild(c)}function k(a){return o[a]||(o[a]=new Promise(function(b,c){j((t.baseURL||"")+"/"+a+".js",function(){if(delete o[a],s.length){var d=s.shift();d[0].call(this,a,d[1],d[2])}q[a]?b(a):c(new Error("Error loading module "+a))})})),o[a]}function l(a){var b,c=q[a];if(!c)return Promise.reject(new Error("Module "+a+" not loaded"));var d=a+"!";return o[d]?o[d]:o[d]=Promise.all(c.deps.map(function(c){if(r[c]||/module|exports|require/.test(c))return Promise.resolve(c);if(b=q[c]){var d=c+"!";return p[c]||o[d]?a:o[d]=l(c).then(function(a){return o[d]=Promise.resolve(a),a})}return k(c).then(l)})).then(function(){return a})}function m(a){var d,e=b(a,[]);return(d=r[e])?Promise.resolve(d):(d=q[e])?p[e]?Promise.resolve(d.exports):l(e).then(c):k(e).then(l).then(c)}var n=document.getElementsByTagName("head")[0],o=Object.create(null),p=Object.create(null),q=Object.create(null),r=Object.create(null),s=[];i.amd={jQuery:!0};var t={set:d,get:e,has:f,"import":m,importAll:function(a){Array.isArray(a)||(a=[].slice.call(arguments));var b=[];return Promise.all(a.map(function(a){var c=/^(.+?)(\.([\w*]+))?$/.exec(a);return a=c[1],b.push(c[3]||"default"),m(a)})).then(function(a){return a.map(function(a,c){return"*"==b[c]?a:a[b[c]]})})},register:h,amdDefine:i,amdRequire:function(a,b){t.importAll(a).spread(b)}};a.System=t,a.define=i,Promise.prototype.spread||(Promise.prototype.spread=function(a){return this.then(function(a){return Promise.all(a)}).then(function(b){return a.apply(this,b)})})}(window);

@@ -327,25 +327,31 @@ /**

// Resolve all of the dependencies of the module.
return Promise.all(mod.deps.map(function (dep) {
if (externalRegistry[dep] || /module|exports|require/.test(dep)) {
// The dependency has been externally set so it should be ready.
return Promise.resolve(dep);
} else if (depMod = internalRegistry[dep]) {
if (executed[dep]) {
// The dependency has been loaded and executed and is ready.
var key = name + '!';
if (loading[key]) {
console.log('Waiting for loadDependencies(%s)', name);
return loading[key];
} else {
return loading[key] = Promise.all(mod.deps.map(function (dep) {
if (externalRegistry[dep] || /module|exports|require/.test(dep)) {
// The dependency has been externally set so it should be ready.
return Promise.resolve(dep);
} else {
// Mark as seen to prevent infinite recursion.
executed[dep] = true;
// The dependency hasn't been executed. Check its dependencies.
return loadDependencies(dep).then(function (name) {
executed[dep] = false;
} else if (depMod = internalRegistry[dep]) {
var key = dep + '!'; // add '!' so we can use the same loading var for dependencies too.
if (executed[dep] || loading[key]) {
// The dependencies are being loaded through another process.
return name;
});
} else {
// The dependency hasn't been executed. Check its dependencies.
return loading[key] = loadDependencies(dep).then(function (name) {
loading[key] = Promise.resolve(name);
return name;
});
}
}
}
// Load the dependencies and then recursively load its dependencies.
return load(dep).then(loadDependencies);
})).then(function () {
return name;
});
// Load the dependency and then recursively load its dependencies.
return load(dep).then(loadDependencies);
})).then(function () {
return name;
});
}
}

@@ -352,0 +358,0 @@

{
"name": "garden-loader",
"version": "1.0.6",
"version": "1.0.7",
"description": "A minimal ES6 System and AMD compatible module loader.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -54,5 +54,5 @@ var assert = chai.assert;

return System.import('es6/component').then(function (mod) {
assert.isTrue(mod.PropTypes !== undefined);
assert.isTrue(mod.React !== undefined);
});
});
});
"use strict";
System.register(["react"], function (_export, _context) {
System.register(["react", "./sub-component"], function (_export, _context) {
"use strict";
var React, PropTypes, _createClass, Component;
var React, SubComponent, _createClass, Component;

@@ -41,3 +41,4 @@ function _classCallCheck(instance, Constructor) {

React = _react.default;
PropTypes = _react.PropTypes;
}, function (_subComponent) {
SubComponent = _subComponent.default;
}],

@@ -63,3 +64,3 @@ execute: function () {

_export("PropTypes", PropTypes);
_export("React", React);

@@ -69,13 +70,6 @@ Component = function (_React$Component) {

function Component(props) {
function Component() {
_classCallCheck(this, Component);
var _this = _possibleConstructorReturn(this, (Component.__proto__ || Object.getPrototypeOf(Component)).call(this, props));
_this.state = {
tracks: [],
hasMoreItems: true,
nextHref: null
};
return _this;
return _possibleConstructorReturn(this, (Component.__proto__ || Object.getPrototypeOf(Component)).apply(this, arguments));
}

@@ -89,3 +83,3 @@

null,
this.props.title
React.createElement(SubComponent, null)
);

@@ -99,12 +93,4 @@ }

_export("default", Component);
Component.defaultProps = {
title: 'Vanilla'
};
Component.propTypes = {
title: PropTypes.string
};
}
};
});

@@ -1,27 +0,10 @@

import React, {PropTypes} from "react";
import React from "react";
import SubComponent from "./sub-component";
export {PropTypes};
export {React};
export default class Component extends React.Component {
constructor(props) {
super(props);
this.state = {
tracks: [],
hasMoreItems: true,
nextHref: null
};
}
render() {
return <div>{this.props.title}</div>
return <div><SubComponent/></div>
}
}
Component.defaultProps = {
title: 'Vanilla',
};
Component.propTypes = {
title: PropTypes.string,
};

@@ -11,2 +11,10 @@ var assert = chai.assert;

});
it('System.importAll() should load AMD modules and ES6 modules.', function () {
return System.importAll('react', 'es6/component', 'es6/component.React').spread(
function (React, Component, React2) {
assert.isFalse(React === undefined);
}
);
})
});
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