UNPKG

487 BJavaScriptView Raw
1var structr = require("structr"),
2resolve = require("resolve");
3
4module.exports = structr({
5
6 /**
7 */
8
9 "__construct": function(loader) {
10 this._loader = loader;
11 this._paths = [process.cwd()];
12 },
13
14 /**
15 */
16
17 "resolve": function(path) {
18 return resolve.sync(path, {
19 paths: this._paths
20 });
21 },
22
23 /**
24 */
25
26 "paths": function() {
27 if(arguments.length) {
28 this._paths.push.apply(this._paths, arguments);
29 } else {
30 return this._paths;
31 }
32 return this._loader;
33 }
34});
\No newline at end of file