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

autoloader

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autoloader - npm Package Compare versions

Comparing version 2.0.1 to 2.1.0

28

autoloader.js

@@ -29,5 +29,3 @@ // Copyright (c) 2013 Daniel Ennis <aikar@aikar.co>

indexMap.push(obj);
obj.__proto__ = proxy(obj.__proto__, loadModule);
dirMap[index] = [];

@@ -48,9 +46,9 @@ }

} else {
var mod = path.join(dir, file);
try {
return require(path.join(dir, file));
} catch (ignored) { }
return require(require.resolve(mod));
} catch (ignored) {}
}
}
}
}

@@ -60,3 +58,4 @@ module.exports = registerAutoloader;

function proxy(target, cb){
var traps = {
return Proxy.create({
getPropertyDescriptor: Object.getOwnPropertyDescriptor.bind(null, target),
getOwnPropertyDescriptor: Object.getOwnPropertyDescriptor.bind(null, target),

@@ -67,3 +66,2 @@ getOwnPropertyNames: Object.getOwnPropertyNames.bind(null, target),

defineProperty: Object.defineProperty.bind(null, target),
get: function(r,k){ return target[k] },
set: function(r,k,v){ target[k] = v; return true },

@@ -73,19 +71,7 @@ has: function(k){ return k in target },

delete: function(k){ delete target[k]; return true },
enumerate: function(){ var i=0,k=[]; for (k[i++] in target); return k }
};
return Proxy.create({
enumerate: function(){ var i=0,k=[]; for (k[i++] in target); return k },
get: function(r, key){
if (key != 'v8debug' && target[key] == undefined) {
var result = cb(key);
if (typeof result == 'undefined') {
throw new ReferenceError(key + ' is not defined');
} else {
return result;
}
return cb(key);
}
if (key in traps) {
return traps[key].apply(target, arguments);
}
}

@@ -92,0 +78,0 @@ }, Object.getPrototypeOf(target));

@@ -5,3 +5,3 @@ {

"description": "Autoloads JS Files",
"version": "2.0.1",
"version": "2.1.0",
"homepage": "http://aikar.co",

@@ -12,2 +12,6 @@ "main": "autoloader.js",

},
"repository": {
"type": "git",
"url": "git://github.com/aikar/autoloader.git"
},
"scripts": {

@@ -14,0 +18,0 @@ "start":"node autoloader.js"

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