diff options
| author | Michael Williamson <mike@zwobble.org> | 2013-04-11 20:12:04 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2013-04-11 20:12:04 +0100 |
| commit | c57b900666a82b4ccce033a923e53906255078c0 (patch) | |
| tree | c8619bf48c3bca17ea3c429194b96c0b3937e16b /lib/docx-reader.js | |
| parent | 57622e1584e7367aa41d4a09f8db33c703a6a0df (diff) | |
Don't guess what the input for conversion is
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) { |
