(url)
| 1578 | } |
| 1579 | |
| 1580 | function getPathFromURLPosix(url) { |
| 1581 | if (url.hostname !== '') { |
| 1582 | throw new ERR_INVALID_FILE_URL_HOST(platform); |
| 1583 | } |
| 1584 | const pathname = url.pathname; |
| 1585 | for (let n = 0; n < pathname.length; n++) { |
| 1586 | if (pathname[n] === '%') { |
| 1587 | const third = StringPrototypeCodePointAt(pathname, n + 2) | 0x20; |
| 1588 | if (pathname[n + 1] === '2' && third === 102) { |
| 1589 | throw new ERR_INVALID_FILE_URL_PATH( |
| 1590 | 'must not include encoded / characters', |
| 1591 | url, |
| 1592 | ); |
| 1593 | } |
| 1594 | } |
| 1595 | } |
| 1596 | // Fast-path: if there is no percent-encoding, avoid decodeURIComponent. |
| 1597 | return StringPrototypeIncludes(pathname, '%') ? decodeURIComponent(pathname) : pathname; |
| 1598 | } |
| 1599 | |
| 1600 | function getPathBufferFromURLPosix(url) { |
| 1601 | if (url.hostname !== '') { |
no outgoing calls
no test coverage detected
searching dependent graphs…