diff --git a/dist/nomnoml.js b/dist/nomnoml.js index ec058bd..6fd5ab5 100644 --- a/dist/nomnoml.js +++ b/dist/nomnoml.js @@ -165,7 +165,7 @@ var nomnoml; var source = fs.readFileSync(filepath, { encoding: 'utf8' }); var directory = path.dirname(filepath); return source.replace(/#import: *(.*)/g, function (a, file) { - return compileFile(path.join(directory, file), depth + 1); + return compileFile(path.join(directory, file), maxImportDepth, depth + 1); }); } nomnoml.compileFile = compileFile; diff --git a/src/node-compiler.ts b/src/node-compiler.ts index d41011b..c3972fa 100644 --- a/src/node-compiler.ts +++ b/src/node-compiler.ts @@ -6,7 +6,7 @@ namespace nomnoml { } } - export function compileFile(filepath: string, maxImportDepth: number, depth?: number): string { + export function compileFile(filepath: string, maxImportDepth: number, depth: number): string { var fs = require('fs') var path = require('path') @@ -18,7 +18,7 @@ namespace nomnoml { var directory = path.dirname(filepath) return source.replace(/#import: *(.*)/g, function (a: any, file: string) { - return compileFile(path.join(directory, file), depth+1) + return compileFile(path.join(directory, file), maxImportDepth, depth+1) }) }