import*as Common from"../common/common.js";import*as Host from"../host/host.js";export class NodeURL{static patch(t){!function t(o,r){o.url&&NodeURL._isPlatformPath(o.url,Host.Platform.isWin())&&(o.url=Common.ParsedURL.ParsedURL.platformPathToURL(o.url));for(const s of Object.entries(o)){const o=s[0],a=s[1],e=r+"."+o;".result.result.value"!==e&&null!==a&&"object"===typeof a&&t(a,e)}}(t,"")}static _isPlatformPath(t,o){if(o){return/^([a-z]:[\/\\]|\\\\)/i.test(t)}return!!t.length&&"/"===t[0]}}