diff options
Diffstat (limited to 'lib/book.js')
-rw-r--r-- | lib/book.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/book.js b/lib/book.js index f615833..a2a11a7 100644 --- a/lib/book.js +++ b/lib/book.js @@ -287,6 +287,14 @@ Book.prototype.isMultilingual = function() { return this.langs.count() > 0; }; +// Return true if file is in the scope of this book +Book.prototype.isInBook = function(filename) { + return pathUtil.isInRoot( + this.root, + this.resolve(filename) + ); +}; + // Return true if file is in the scope of a child book Book.prototype.isInLanguageBook = function(filename) { return _.some(this.langs.list(), function(lang) { |