mirror of
https://github.com/samsonjs/batteries.git
synced 2026-04-27 15:07:42 +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) {
|
fs.readdirSync(__dirname).forEach(function (file) {
|
||||||
file = file.replace('.js', '');
|
file = file.replace('.js', '');
|
||||||
if (file !== 'index') {
|
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) {
|
function defineLazyProperty(obj, name, getter) {
|
||||||
Object.defineProperty(obj, name, {
|
Object.defineProperty(obj, name, {
|
||||||
configurable: true
|
configurable: true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue