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 /lib/zipfile.js | |
| parent | 12eb3306caaa503e887539a3cf641116156a43c6 (diff) | |
Extract joinZipPath to zipfile
Diffstat (limited to 'lib/zipfile.js')
| -rw-r--r-- | lib/zipfile.js | 6 |
1 files changed, 6 insertions, 0 deletions
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; +} |
