index.js
function ParsePath(u) {
    //Parse the url
    let p = url.parse(u);
    //Get the path name
    let pname = p.pathname;
    //Check for Windows
    if( process.platform === "win32") {
        //Remove the first / from the path
        //https://github.com/jmjuanes/electron-ejs/pull/4#issuecomment-219254028
        pname = pname.substr(1);
    }
    //Sanitize URL. Spaces turn into `%20` symbols in the path and
    //throws a `File Not Found Event`. This fix allows folder paths to have
    //spaces in the folder name.
    //https://github.com/jmjuanes/electron-ejs/pull/9
    return pname.replace(/\s/g, " ").replace(/%20/g, " ");
}
function ParsePath(u) {
    //Parse the url
    let p = url.parse(u);
    //Get the path name
    let pname = p.pathname;
    //Check for Windows
    if( process.platform === "win32") {
        //Remove the first / from the path
        //https://github.com/jmjuanes/electron-ejs/pull/4#issuecomment-219254028
        pname = pname.substr(1);
    }
    //Sanitize URL. Spaces turn into `%20` symbols in the path and
    //throws a `File Not Found Event`. This fix allows folder paths to have
    //spaces in the folder name.
    //https://github.com/jmjuanes/electron-ejs/pull/9
    return pname.replace(/\s/g, " ").replace(/%20/g, " ");
}
function ParsePath ( u ) { //Parse the url let p = url . parse ( u ) ; //Get the path name let pname = p . pathname ; //Check for Windows if ( process . platform === "win32" ) { //Remove the first / from the path //https://github.com/jmjuanes/electron-ejs/pull/4#issuecomment-219254028 pname = pname . substr ( 1 ) ; } //Sanitize URL. Spaces turn into `%20` symbols in the path and //throws a `File Not Found Event`. This fix allows folder paths to have //spaces in the folder name. //https://github.com/jmjuanes/electron-ejs/pull/9 return pname . replace ( / \s / g , " " ) . replace ( / %20 / g , " " ) ; }
Function to parse the path
Function to parse the path