diff --git a/lib/index.js b/lib/index.js index d7aadd5..31b2a04 100644 --- a/lib/index.js +++ b/lib/index.js @@ -39,7 +39,7 @@ function parseUrl(url, normalize = false) { if (normalize) { if (typeof normalize !== "object") { normalize = { - stripFragment: false + stripHash: false } } url = normalizeUrl(url, normalize) diff --git a/test/index.js b/test/index.js index 159c904..339af1f 100644 --- a/test/index.js +++ b/test/index.js @@ -71,6 +71,19 @@ const INPUTS = [ , search: "" } ] + , [ + ["http://ionicabizau.net/with-true-normalize", true] + , { + protocols: [ "http" ] + , protocol: "http" + , port: null + , resource: "ionicabizau.net" + , user: "" + , pathname: "/with-true-normalize" + , hash: "" + , search: "" + } + ] ]; tester.describe("check urls", test => { @@ -80,7 +93,7 @@ tester.describe("check urls", test => { const res = parseUrl(url, c[0][1] !== false); if (c[0][1] !== false) { url = normalizeUrl(url, { - stripFragment: false + stripHash: false }) } c[1].query = qs.parse(c[1].search)