dependable
Advanced tools
Comparing version 0.2.3 to 0.2.4
18
index.js
@@ -12,5 +12,19 @@ // Generated by CoffeeScript 1.3.3 | ||
exports.container = function() { | ||
var argList, container, factories, get, haveVisited, load, loaddir, loadfile, notEmpty, register, resolve, toFactory; | ||
var argList, container, factories, get, haveVisited, load, loaddir, loadfile, notEmpty, register, registerOne, resolve, toFactory; | ||
factories = {}; | ||
register = function(name, func) { | ||
var hash, _results; | ||
if (name === Object(name)) { | ||
hash = name; | ||
_results = []; | ||
for (name in hash) { | ||
func = hash[name]; | ||
_results.push(registerOne(name, func)); | ||
} | ||
return _results; | ||
} else { | ||
return registerOne(name, func); | ||
} | ||
}; | ||
registerOne = function(name, func) { | ||
if (!(func != null)) { | ||
@@ -47,3 +61,3 @@ throw new Error("cannot register null function"); | ||
file = files[_i]; | ||
if (!file.match(/\.(js|coffee)/)) { | ||
if (!file.match(/\.(js|coffee)$/)) { | ||
continue; | ||
@@ -50,0 +64,0 @@ } |
{ | ||
"name": "dependable", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "author": "Sean Hess", |
@@ -131,2 +131,4 @@ # Dependable | ||
`container.register(hash)` - registers a hash of names and dependencies. Useful for config. | ||
`container.load(fileOrFolder)` - registers a file, using its file name as the name, or all files in a folder. Does not follow sub directories | ||
@@ -133,0 +135,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
21526
165
143
1