(name, root)
| 48 | }; |
| 49 | |
| 50 | var require = function(name, root) { |
| 51 | var path = expand(root, name); |
| 52 | var fullPath; |
| 53 | |
| 54 | if (fullPath = getFullPath(path, true)) { |
| 55 | return cache[fullPath]; |
| 56 | } else if (fullPath = getFullPath(path, false)) { |
| 57 | return cacheModule(name, fullPath, modules[fullPath]); |
| 58 | } else { |
| 59 | throw new Error("Cannot find module '" + name + "'"); |
| 60 | } |
| 61 | }; |
| 62 | |
| 63 | var dirname = function(path) { |
| 64 | return path.split('/').slice(0, -1).join('/'); |
no test coverage detected
searching dependent graphs…