mirror of
https://github.com/samsonjs/batteries.git
synced 2026-03-25 09:15:46 +00:00
ext does not need to be a function any more
This commit is contained in:
parent
b9667705d8
commit
f94cf785d0
1 changed files with 2 additions and 6 deletions
|
|
@ -9,15 +9,11 @@ var fs = require('fs')
|
|||
fs.readdirSync(__dirname).forEach(function (file) {
|
||||
file = file.replace('.js', '');
|
||||
if (file !== 'index') {
|
||||
ext(file);
|
||||
exts.push(name);
|
||||
defineLazyProperty(batteries, name, function() { return require('./' + name); });
|
||||
}
|
||||
});
|
||||
|
||||
function ext(name) {
|
||||
exts.push(name);
|
||||
defineLazyProperty(batteries, name, function() { return require('./' + name); });
|
||||
};
|
||||
|
||||
function defineLazyProperty(obj, name, getter) {
|
||||
Object.defineProperty(obj, name, {
|
||||
configurable: true
|
||||
|
|
|
|||
Loading…
Reference in a new issue