diff options
| author | Michael Williamson <mike@zwobble.org> | 2017-01-23 18:02:42 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2017-01-23 18:24:43 +0000 |
| commit | c107c1c2b571947c0bc1f03f53b065b82f6a4c8f (patch) | |
| tree | b236d9b08716eabf7bed7fd16a7498d3f9d992dd | |
| parent | 12eb3306caaa503e887539a3cf641116156a43c6 (diff) | |
Extract joinZipPath to zipfile
| -rw-r--r-- | lib/docx/body-reader.js | 7 | ||||
| -rw-r--r-- | lib/zipfile.js | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/docx/body-reader.js b/lib/docx/body-reader.js index 2d74c13..175b724 100644 --- a/lib/docx/body-reader.js +++ b/lib/docx/body-reader.js @@ -5,6 +5,7 @@ var _ = require("underscore"); var documents = require("../documents"); var Result = require("../results").Result; var warning = require("../results").warning; +var joinZipPath = require("../zipfile").joinZipPath; function BodyReader(options) { @@ -420,12 +421,6 @@ function negate(predicate) { }; } -function joinZipPath(first, second) { - // In general, we should check first and second for trailing and leading slashes, - // but in our specific case this seems to be sufficient - return first + "/" + second; -} - function emptyResultWithMessages(messages) { return new ReadResult(null, null, messages); diff --git a/lib/zipfile.js b/lib/zipfile.js index eb6bf66..708b07a 100644 --- a/lib/zipfile.js +++ b/lib/zipfile.js @@ -3,6 +3,7 @@ var JSZip = require("jszip"); var promises = require("./promises"); exports.openArrayBuffer = openArrayBuffer; +exports.joinZipPath = joinZipPath; function openArrayBuffer(arrayBuffer) { var zipFile = new JSZip(arrayBuffer); @@ -36,3 +37,8 @@ function openArrayBuffer(arrayBuffer) { }; } +function joinZipPath(first, second) { + // In general, we should check first and second for trailing and leading slashes, + // but in our specific case this seems to be sufficient + return first + "/" + second; +} |
