import { Request } from 'express' ; import { convertFields } from './convert-fields' ; import { RestRequest } from './types' ; export function parseQuery ( req ) { const out = req ; out . restgoose = { } ; if ( req . query ) { if ( req . query . q ) { out . restgoose . query = convertFields ( JSON . parse ( req . query . q ) ) ; } } return out ; }