Comparing version 0.7.5 to 0.7.6
@@ -394,3 +394,3 @@ 'use strict'; | ||
function stringifyParsedURL(parsed) { | ||
const fullpath = parsed.pathname + (parsed.search ? "?" + parsed.search : "") + parsed.hash; | ||
const fullpath = parsed.pathname + (parsed.search ? (parsed.search.startsWith("?") ? "" : "?") + parsed.search : "") + parsed.hash; | ||
if (!parsed.protocol) { | ||
@@ -397,0 +397,0 @@ return fullpath; |
{ | ||
"name": "ufo", | ||
"version": "0.7.5", | ||
"version": "0.7.6", | ||
"description": "URL utils for humans", | ||
@@ -5,0 +5,0 @@ "repository": "unjs/ufo", |
@@ -65,2 +65,15 @@ [![npm version][npm-version-src]][npm-version-href] | ||
### `parseURL` | ||
```ts | ||
// Result: { protocol: 'http:', auth: '', host: 'foo.com', pathname: '/foo', search: '?test=123', hash: '#token' } | ||
parseURL('http://foo.com/foo?test=123#token') | ||
// Result: { pathname: 'foo.com/foo', search: '?test=123', hash: '#token' } | ||
parseURL('foo.com/foo?test=123#token') | ||
// Result: { protocol: 'https:', auth: '', host: 'foo.com', pathname: '/foo', search: '?test=123', hash: '#token' } | ||
parseURL('foo.com/foo?test=123#token', 'https://') | ||
``` | ||
### `withQuery` | ||
@@ -67,0 +80,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36591
172