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) {