Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

839
Vistas
Express - Request.query type definition is ParsedQs. Why is it recursive?

The type of request.query is ParsedQs which has the following definition:

interface ParsedQs {
    [key: string]: undefined
        | string
        | string[]
        | ParsedQs
        | ParsedQs[]
}

My guess for each types is the following:

  • A value is undefined when it isn't mentioned in the params.
    For instance: reading request.query.b when the params are ?a=1.

  • A value is a string when it's mentioned once in the params. For instance: reading request.query.a when the params are ?a=1.

  • A value is a string[] when it's mentioned multiple times in the params. For instance: reading request.query.a when the params are ?a=1&a=2.

But when is a value a ParsedQs itself?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The query ?a[x]=b&a[y]=c is parsed into {"a":{"x":"b","y":"c"}}.

And ?a[x]=b&a=c is parsed into {"a":[{"x":"b"},"c"]}.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda