lib, url: add a windows option to path parsing

PR-URL: https://github.com/nodejs/node/pull/52509
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
This commit is contained in:
Aviv Keller 2024-04-24 11:47:48 -04:00 committed by GitHub
parent 91dc8c93a3
commit ac9aa37bcb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 267 additions and 216 deletions

View file

@ -1020,10 +1020,10 @@ Url.prototype.parseHost = function parseHost() {
// When used internally, we are not obligated to associate TypeError with
// this function, so non-strings can be rejected by underlying implementation.
// Public API has to validate input and throw appropriate error.
function pathToFileURL(path) {
function pathToFileURL(path, options) {
validateString(path, 'path');
return _pathToFileURL(path);
return _pathToFileURL(path, options);
}
module.exports = {