diff options
Diffstat (limited to 'lib/docx-reader.js')
| -rw-r--r-- | lib/docx-reader.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/docx-reader.js b/lib/docx-reader.js index fcc69fe..832ff31 100644 --- a/lib/docx-reader.js +++ b/lib/docx-reader.js @@ -15,10 +15,15 @@ var DocumentXmlReader = require("./document-xml-reader").DocumentXmlReader; var Result = require("./results").Result; -function read(docxFile) { - if (_.isString(docxFile)) { +function read(options) { + var docxFile; + if (options.path) { var zipPath = docxFile; - docxFile = openZip(zipPath); + docxFile = openZip(options.path); + } else if (options.file) { + docxFile = options.file; + } else { + return q.reject(new Error("Could not find file in options")); } return q.when(docxFile, function(docxFile) { |
