mirror of https://gitee.com/bigwinds/arangodb
workaround for index modules
This commit is contained in:
parent
4a972d3f55
commit
c205e3236a
|
@ -166,6 +166,10 @@ Module.prototype.define = function (path, definition) {
|
||||||
|
|
||||||
// first get rid of any ".." and "."
|
// first get rid of any ".." and "."
|
||||||
path = this.normalise(path);
|
path = this.normalise(path);
|
||||||
|
var match = path.match(/(.+)\/index$/);
|
||||||
|
if (match) {
|
||||||
|
path = match[1];
|
||||||
|
}
|
||||||
|
|
||||||
// check if you already know the module, return the exports
|
// check if you already know the module, return the exports
|
||||||
if (! Module.prototype.moduleCache.hasOwnProperty(path)) {
|
if (! Module.prototype.moduleCache.hasOwnProperty(path)) {
|
||||||
|
|
Loading…
Reference in New Issue