From aaa036f3e7dad6063af873b13b93dfbff0385d79 Mon Sep 17 00:00:00 2001 From: Tony Kovanen Date: Sat, 23 Apr 2016 15:52:46 +0300 Subject: [PATCH] Fix path handling for windows --- lib/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/index.js b/lib/index.js index 773dd97..4d2f757 100644 --- a/lib/index.js +++ b/lib/index.js @@ -224,10 +224,10 @@ export default class Now extends EventEmitter { } function toRelative (path, base) { - const fullBase = base.endsWith(SEP) ? base + SEP : base; - const relative = path.substr(fullBase.length); - if (relative.startsWith(SEP)) return relative.substr(1); - return relative; + const fullBase = base.endsWith(SEP) ? base : base + SEP; + let relative = path.substr(fullBase.length); + if (relative.startsWith(SEP)) relative = relative.substr(1); + return relative.replace(/\\/g, '/'); } function responseError (res) {