normalizePath handles spaces for use in resolvePath

This commit is contained in:
Jerry Holmes
2017-05-10 22:13:03 -04:00
parent 018616dc68
commit f7c2dec8e8
3 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,5 @@
const absolutePath = new RegExp('^(?:[a-z]+:)?//', 'i');
const normalizePath = path => path.replace(/[\\\/]+/g, '/');
const normalizePath = path => path.replace(/[\\\/]+/g, '/').replace(/[\s]+/g, '%20');
export function resolvePath(path, basePath) { // eslint-disable-line
// No path provided, skip