summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-06-14 11:54:04 +0100
committerMichael Williamson <mike@zwobble.org>2015-06-14 11:54:04 +0100
commitaaabb8c8d6d3f0f61064d906ea86342a87bb0c3f (patch)
treeba29717adf0f561a44306d0fe99bab133e20ec58
parentd8ce710c8f675f48707057325376b1c27750eb77 (diff)
Remove document property on result from docx reading
-rw-r--r--lib/docx/document-xml-reader.js4
-rw-r--r--tests/docx/docx-reader.tests.js4
2 files changed, 3 insertions, 5 deletions
diff --git a/lib/docx/document-xml-reader.js b/lib/docx/document-xml-reader.js
index 662758c..ab48fe7 100644
--- a/lib/docx/document-xml-reader.js
+++ b/lib/docx/document-xml-reader.js
@@ -19,14 +19,12 @@ function DocumentXmlReader(options) {
function convertXmlToDocument(documentXml) {
var body = documentXml.root.first("w:body");
- var result = readXmlElements(body.children)
+ return readXmlElements(body.children)
.flatMap(function(children) {
return readNotes().map(function(notes) {
return new documents.Document(children, {notes: notes});
});
});
- result.document = result.value;
- return result;
}
function readNotes() {
diff --git a/tests/docx/docx-reader.tests.js b/tests/docx/docx-reader.tests.js
index 31c7f56..e8d5511 100644
--- a/tests/docx/docx-reader.tests.js
+++ b/tests/docx/docx-reader.tests.js
@@ -22,7 +22,7 @@ describe("docx-reader", function() {
"word/document.xml": testData("simple/word/document.xml")
});
return docxReader.read({file: docxFile}).then(function(result) {
- assert.deepEqual(expectedDocument, result.document);
+ assert.deepEqual(expectedDocument, result.value);
});
});
@@ -32,7 +32,7 @@ describe("docx-reader", function() {
"word/_rels/document.xml.rels": testData("hyperlinks/word/_rels/document.xml.rels")
});
return docxReader.read({file: docxFile}).then(function(result) {
- var paragraph = result.document.children[0];
+ var paragraph = result.value.children[0];
assert.equal(1, paragraph.children.length);
var hyperlink = paragraph.children[0];
assert.equal(hyperlink.href, "http://www.example.com");