diff options
Diffstat (limited to 'lib/caldav/caldav.js')
-rw-r--r-- | lib/caldav/caldav.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/caldav/caldav.js b/lib/caldav/caldav.js index ee1b92d..f3c6cad 100644 --- a/lib/caldav/caldav.js +++ b/lib/caldav/caldav.js @@ -20,6 +20,16 @@ Exports.prototype = { /** + * Associate and register module. + * + * @param {String} path uri associated with module. + * @param {Object} object module object. + */ + register: function(path, object) { + paths[path] = object; + }, + + /** * Unified require between browser/node. * Path is relative to this file so you * will want to use it like this from any depth. @@ -46,7 +56,7 @@ * Maps exports to a file path. */ set exports(val) { - return paths[this.path] = val; + this.register(this.path, val); }, get exports() { @@ -69,11 +79,11 @@ return new Exports(path); } + Module.register = Exports.prototype.register; Module.require = Exports.prototype.require; Module.exports = Module; Module._paths = paths; - /** * Reference self as exports * which also happens to be the constructor |