MCPcopy
hub / github.com/docsifyjs/docsify / parseQuery

Function parseQuery

src/core/router/util.js:6–23  ·  view source on GitHub ↗
(query)

Source from the content-addressed store, hash-verified

4const encode = encodeURIComponent;
5
6export function parseQuery(query) {
7 const res = {};
8
9 query = query.trim().replace(/^(\?|#|&)/, '');
10
11 if (!query) {
12 return res;
13 }
14
15 // Simple parse
16 query.split('&').forEach(function (param) {
17 const parts = param.replace(/\+/g, ' ').split('=');
18
19 res[parts[0]] = parts[1] && decode(parts[1]);
20 });
21
22 return res;
23}
24
25export function stringifyQuery(obj, ignores = []) {
26 const qs = [];

Callers 3

parseMethod · 0.90
parseMethod · 0.90
parseMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…