aboutsummaryrefslogtreecommitdiff
path: root/lib/docx/content-types-reader.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-03-18 14:24:56 +0000
committerMichael Williamson <mike@zwobble.org>2014-03-18 14:24:56 +0000
commit800b14eed0c909c93a3271191ac93ad5a2d2057f (patch)
tree97d326d84fd30c188377314bbdf23ca9fcb7a1db /lib/docx/content-types-reader.js
parent45f302766a3a5ca99338fd8e5fef07dec42c0e56 (diff)
Move reading of actual docx files into docx-reader
Diffstat (limited to 'lib/docx/content-types-reader.js')
-rw-r--r--lib/docx/content-types-reader.js22
1 files changed, 5 insertions, 17 deletions
diff --git a/lib/docx/content-types-reader.js b/lib/docx/content-types-reader.js
index 0a74eb9..c8a28a4 100644
--- a/lib/docx/content-types-reader.js
+++ b/lib/docx/content-types-reader.js
@@ -1,16 +1,11 @@
-var readXmlFromZipFile = require("./office-xml-reader").readXmlFromZipFile;
-
-exports.readContentTypesFromZipFile = readContentTypesFromZipFile;
exports.readContentTypesFromXml = readContentTypesFromXml;
+exports.defaultContentTypes = {
+ findContentType: function(path) {
+ return null;
+ }
+};
-function readContentTypesFromZipFile(file) {
- return readXmlFromZipFile(file, "[Content_Types].xml")
- .then(function(xml) {
- return xml ? readContentTypesFromXml(xml) : defaultContentTypes;
- });
-}
-
function readContentTypesFromXml(xml) {
var extensionDefaults = {};
var overrides = {};
@@ -41,10 +36,3 @@ function readContentTypesFromXml(xml) {
}
}
}
-
-
-var defaultContentTypes = {
- findContentType: function(path) {
- return null;
- }
-};