(uri: string)
| 1791 | * Encodes the URI path portion (ignores part after ? or #) |
| 1792 | */ |
| 1793 | export function encodeURIPath(uri: string): string { |
| 1794 | if (uri.startsWith('data:')) return uri |
| 1795 | const filePath = cleanUrl(uri) |
| 1796 | const postfix = filePath !== uri ? uri.slice(filePath.length) : '' |
| 1797 | return encodeURI(filePath) + postfix |
| 1798 | } |
| 1799 | |
| 1800 | /** |
| 1801 | * Like `encodeURIPath`, but only replacing `%` as `%25`. This is useful for environments |
no test coverage detected