Skip to content

normalizeQueryStateSchema @vuqs/core ​

Normalizes codec shorthand into param definitions while preserving existing definitions.

Usage ​

ts
import { codecs, normalizeQueryStateSchema } from '@vuqs/core'

const schema = normalizeQueryStateSchema({ q: codecs.string })
schema.q.paths // ['q']

Type ​

ts
function normalizeQueryStateSchema<TSchema extends QueryStateSchemaInput>(
  schema: TSchema,
): NormalizeQueryStateSchema<TSchema>

Parameters ​

ParameterTypeDescription
schemaTSchema extends QueryStateSchemaInputCodecs or definitions keyed by logical param name.

Return value ​

NormalizeQueryStateSchema<TSchema>. Codec entries become definitions owning their logical name as a query path. Existing definitions are retained.

Reusable schemas.

Released under the MIT License. Inspired by nuqs.