Comparing version 0.1.0 to 0.1.1
13
index.js
@@ -6,6 +6,11 @@ var fs = require('fs'), | ||
var modules = {}; | ||
options = merge(options || {}, { | ||
lazy: true, | ||
init: function(mod){ return mod; } | ||
}); | ||
options = options || {}; | ||
if (typeof options === 'function') { | ||
options = {init: options}; | ||
} else { | ||
options = merge(options, { | ||
lazy: true, | ||
init: function(mod){ return mod; } | ||
}); | ||
} | ||
@@ -12,0 +17,0 @@ fs.readdirSync(dir).forEach(function(filename) { |
{ | ||
"name": "moder", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Module loader", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -34,7 +34,7 @@ var path = require('path'), | ||
it('should support initialization', function() { | ||
var case4 = moder(__dirname + '/modules/case4', {init: function(mod) { | ||
var case4 = moder(__dirname + '/modules/case4', function(mod) { | ||
return 'anothername'; | ||
}}); | ||
}); | ||
assert.equal(case4.mod, 'anothername'); | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5634
81