MCPcopy
hub / github.com/sindresorhus/query-string / parseUrl

Function parseUrl

base.js:534–551  ·  view source on GitHub ↗
(url, options)

Source from the content-addressed store, hash-verified

532}
533
534export function parseUrl(url, options) {
535 options = {
536 decode: true,
537 ...options,
538 };
539
540 let [url_, hash] = splitOnFirst(url, '#');
541
542 if (url_ === undefined) {
543 url_ = url;
544 }
545
546 return {
547 url: getUrlWithoutQuery(url_ ?? ''),
548 query: parse(extract(url), options),
549 ...(options && options.parseFragmentIdentifier && hash ? {fragmentIdentifier: decode(hash, options)} : {}),
550 };
551}
552
553export function stringifyUrl(object, options) {
554 options = {

Callers 1

pickFunction · 0.85

Calls 4

getUrlWithoutQueryFunction · 0.85
parseFunction · 0.85
extractFunction · 0.85
decodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…