NodeURL.js 719 B

1234
  1. export default class NodeURL{static patch(object){process(object,'');function process(object,path){if(object.url&&NodeURL._isPlatformPath(object.url,Host.isWin())){object.url=Common.ParsedURL.platformPathToURL(object.url);}
  2. for(const entry of Object.entries(object)){const key=entry[0];const value=entry[1];const entryPath=path+'.'+key;if(entryPath!=='.result.result.value'&&value!==null&&typeof value==='object'){process(value,entryPath);}}}}
  3. static _isPlatformPath(fileSystemPath,isWindows){if(isWindows){const re=/^([a-z]:[\/\\]|\\\\)/i;return re.test(fileSystemPath);}else{return fileSystemPath.length?fileSystemPath[0]==='/':false;}}}
  4. self.Protocol=self.Protocol||{};Protocol=Protocol||{};Protocol.NodeURL=NodeURL;