diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-04-23 17:10:16 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-04-23 17:10:16 +0200 |
commit | e1fa977b5b1b3c03790de6e2c21ee39ba55d9555 (patch) | |
tree | a1ad4386100b5779ef930845093c14639a3353b5 /lib/models/file.js | |
parent | ce95f316b9ce1eac1e615db3540c4d0f30408d63 (diff) | |
download | gitbook-e1fa977b5b1b3c03790de6e2c21ee39ba55d9555.zip gitbook-e1fa977b5b1b3c03790de6e2c21ee39ba55d9555.tar.gz gitbook-e1fa977b5b1b3c03790de6e2c21ee39ba55d9555.tar.bz2 |
Add json encoding utils
Diffstat (limited to 'lib/models/file.js')
-rw-r--r-- | lib/models/file.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/models/file.js b/lib/models/file.js index ebfe629..b6b06ee 100644 --- a/lib/models/file.js +++ b/lib/models/file.js @@ -20,6 +20,20 @@ File.prototype.getMTime = function() { }; /** + Return type of file ('markdown' or 'asciidoc') + + @return {String} +*/ +File.prototype.getType = function() { + var parser = this.getParser(); + if (parser) { + return parser.name; + } else { + return undefined; + } +}; + +/** Return extension of this file (lowercased) @return {String} |