From 8b9ca6ca68fec89926cfb02a96506bbee54a5b2c Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Fri, 26 Jan 2018 23:30:13 +0000 Subject: Find comments part using document relationships --- lib/zipfile.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'lib/zipfile.js') diff --git a/lib/zipfile.js b/lib/zipfile.js index ae51310..8d46d92 100644 --- a/lib/zipfile.js +++ b/lib/zipfile.js @@ -51,7 +51,19 @@ function splitPath(path) { } function joinPath() { - return Array.prototype.filter.call(arguments, function(path) { + var nonEmptyPaths = Array.prototype.filter.call(arguments, function(path) { return path; - }).join("/"); + }); + + var relevantPaths = []; + + nonEmptyPaths.forEach(function(path) { + if (/^\//.test(path)) { + relevantPaths = [path]; + } else { + relevantPaths.push(path); + } + }); + + return relevantPaths.join("/"); } -- cgit v1.2.3