File tree Expand file tree Collapse file tree 2 files changed +17
-13
lines changed Expand file tree Collapse file tree 2 files changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,12 @@ This driver uses semantic versioning:
2626 Any names used when creating/ensuring indexes or passed to any methods that
2727 expect an ` IndexSelector ` will automatically be NFC normalized.
2828
29+ - Internal querystring handling logic now uses ` URLSearchParams ` instead of
30+ node ` querystring ` module
31+
32+ This change should be backwards compatible but may produce different results
33+ when relying on undefined behavior in custom (e.g. Foxx) routes.
34+
2935## [ 8.1.0] - 2022-12-19
3036
3137### Added
Original file line number Diff line number Diff line change 1- import { ParsedUrlQueryInput , stringify } from "querystring" ;
2-
3- // eslint-disable-next-line @typescript-eslint/ban-types
4- function clean < T extends { } > ( obj : T ) {
5- const result = { } as typeof obj ;
6- for ( const key of Object . keys ( obj ) ) {
7- const value = ( obj as any ) [ key ] ;
1+ export function querystringify ( obj : Record < string , any > ) {
2+ const params = new URLSearchParams ( ) ;
3+ for ( const [ key , value ] of Object . entries ( obj ) ) {
84 if ( value === undefined ) continue ;
9- ( result as any ) [ key ] = value ;
5+ if ( ! Array . isArray ( value ) ) {
6+ params . append ( key , value ) ;
7+ } else {
8+ for ( const item of value ) {
9+ params . append ( key , item ) ;
10+ }
11+ }
1012 }
11- return result ;
12- }
13-
14- export function querystringify ( obj : ParsedUrlQueryInput ) {
15- return stringify ( clean ( obj ) ) ;
13+ return String ( params ) ;
1614}
You can’t perform that action at this time.
0 commit comments