query-string
Advanced tools
Comparing version
@@ -289,3 +289,4 @@ export type ParseOptions = { | ||
``` | ||
Note: The `'boolean'` type will also convert `'0'` and `'1'` string values to booleans. | ||
Note: The `'boolean'` type also converts `'0'` and `'1'` to booleans, and treats valueless keys (e.g. `?flag`) as `true`. | ||
*/ | ||
@@ -292,0 +293,0 @@ readonly types?: Record< |
@@ -312,2 +312,6 @@ import decodeComponent from 'decode-uri-component'; | ||
if (type === 'boolean' && value === null) { | ||
return true; | ||
} | ||
if (type === 'boolean' && value !== null && (value.toLowerCase() === 'true' || value.toLowerCase() === 'false')) { | ||
@@ -314,0 +318,0 @@ return value.toLowerCase() === 'true'; |
{ | ||
"name": "query-string", | ||
"version": "9.2.1", | ||
"version": "9.2.2", | ||
"description": "Parse and stringify URL query strings", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -220,3 +220,3 @@ # query-string | ||
Note: The `'boolean'` type will also convert `'0'` and `'1'` string values to booleans. | ||
Note: The `'boolean'` type also converts `'0'` and `'1'` to booleans, and treats valueless keys (e.g. `?flag`) as `true`. | ||
@@ -223,0 +223,0 @@ - `'string'`: Parse `phoneNumber` as a string (overriding the `parseNumbers` option): |
52973
0.25%989
0.3%