aboutsummaryrefslogtreecommitdiff
path: root/lib/zipfile.js
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2018-01-26 23:30:13 +0000
committerMichael Williamson <mike@zwobble.org>2018-01-26 23:30:13 +0000
commit8b9ca6ca68fec89926cfb02a96506bbee54a5b2c (patch)
tree34f701ec9078d533d86ad63fc6aa11dbd91ad278 /lib/zipfile.js
parent9196e8bc6f2ff2c59a9b4fde4813e7bc26b8c23d (diff)
Find comments part using document relationships
Diffstat (limited to 'lib/zipfile.js')
-rw-r--r--lib/zipfile.js16
1 files changed, 14 insertions, 2 deletions
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("/");
}