Comparing version 1.0.0 to 1.0.1
@@ -22,5 +22,6 @@ var fs = require('fs'), | ||
var modulePath = path.join(dir, moduleName); | ||
var exportName = camelcase(moduleName); | ||
// lazy load | ||
if (options.lazy) { | ||
Object.defineProperty(modules, camelcase(moduleName), { | ||
Object.defineProperty(modules, exportName, { | ||
get: function() { | ||
@@ -31,3 +32,3 @@ return options.init(require(modulePath)); | ||
} else { | ||
modules[moduleName] = options.init(require(modulePath)); | ||
modules[exportName] = options.init(require(modulePath)); | ||
} | ||
@@ -34,0 +35,0 @@ } |
{ | ||
"name": "moder", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Module loader", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -51,2 +51,7 @@ var path = require('path'), | ||
}); | ||
it('should convert module name to camel case without lazy evaluation', function() { | ||
var case7 = moder(__dirname + '/modules/case7', {lazy: false}); | ||
assert.deepEqual(case7.fooBar, 'hello world'); | ||
}); | ||
}); |
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
6806
25
103