aboutsummaryrefslogtreecommitdiff
path: root/lib/relationships-reader.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-03-18 14:15:33 +0000
committerMichael Williamson <mike@zwobble.org>2014-03-18 14:15:33 +0000
commit45f302766a3a5ca99338fd8e5fef07dec42c0e56 (patch)
treee5081b43310e6c3698c08ab021e0d61d0a84d09c /lib/relationships-reader.js
parentdca50ccd84f91a7db2a41a59e15b3ed95b2c3f46 (diff)
Move modules for docx reading into separate directory
Diffstat (limited to 'lib/relationships-reader.js')
-rw-r--r--lib/relationships-reader.js25
1 files changed, 0 insertions, 25 deletions
diff --git a/lib/relationships-reader.js b/lib/relationships-reader.js
deleted file mode 100644
index fe6c7f1..0000000
--- a/lib/relationships-reader.js
+++ /dev/null
@@ -1,25 +0,0 @@
-var readXmlFromZipFile = require("./office-xml-reader").readXmlFromZipFile;
-
-
-exports.readRelationshipsFromZipFile = readRelationshipsFromZipFile;
-
-
-function readRelationshipsFromZipFile(file) {
- return readXmlFromZipFile(file, "word/_rels/document.xml.rels")
- .then(function(relationshipsXml) {
- return relationshipsXml ? readRelationships(relationshipsXml) : {};
- });
-}
-
-
-function readRelationships(relationshipsXml) {
- var relationships = {};
- relationshipsXml.root.children.forEach(function(child) {
- if (child.name === "{http://schemas.openxmlformats.org/package/2006/relationships}:Relationship") {
- relationships[child.attributes.Id] = {
- target: child.attributes.Target
- };
- }
- });
- return relationships;
-}