Skip to content

Function: queryStringParse()

ts
function queryStringParse(query): Record<string, string>;

Parses a query string into an object.

Parameters

ParameterTypeDescription
querystringThe query string, with or without a leading ?.

Returns

Record<string, string>

The parsed query object.

Example

ts
queryStringParse('a=1&b=x')
// => { a: '1', b: 'x' }

Since

1.0.0

Released under the MIT License.