From c107c1c2b571947c0bc1f03f53b065b82f6a4c8f Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 23 Jan 2017 18:02:42 +0000 Subject: Extract joinZipPath to zipfile --- lib/zipfile.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/zipfile.js') 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; +} -- cgit v1.2.3