From 45f302766a3a5ca99338fd8e5fef07dec42c0e56 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 18 Mar 2014 14:15:33 +0000 Subject: Move modules for docx reading into separate directory --- lib/relationships-reader.js | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 lib/relationships-reader.js (limited to 'lib/relationships-reader.js') 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; -} -- cgit v1.2.3