From c57b900666a82b4ccce033a923e53906255078c0 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 11 Apr 2013 20:12:04 +0100 Subject: Don't guess what the input for conversion is --- lib/docx-reader.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/docx-reader.js') 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) { -- cgit v1.2.3