URL.format includes the leading slashes regardless of what the slashes property is set to. The behavior is not present in node's URL package. ```js const nodeUrl = require("url"); const npmUrl = require("./node_modules/url"); console.log(nodeUrl.format({ hostname: "example.com", slashes: false })); // => example.com (good) console.log(npmUrl.format({ hostname: "example.com", slashes: false })); // => //example.com (bad) console.log(nodeUrl.format({ hostname: "example.com", slashes: true })); // => //example.com console.log(npmUrl.format({ hostname: "example.com", slashes: true })); // => //example.com ``` I am using: NodeJS 10.16.0 url package 0.11.0
Activity
ljharb commentedon Jan 27, 2021
Thanks, this definitely seems like a bug (altho it's also possible that these examples do the same thing in an older version of node).
Once tests on this repo are sorted out, a PR with a failing test case (with or without a fix) would be appreciated.
ljharb commentedon Jan 28, 2021
See #53 as well; this will be addressed as part of "node catchup".