Required option for query params · Issue #1404 · 47ng/nuqs · GitHub
Skip to content

Required option for query params #1404

Open

Description

@nimrossum

Similar to strict, it would be handy with a required option that throws if the parameter is missing

const searchParamsConfig = {
  count: parseAsInteger.withOptions({ required: true }),
}

const loadSearchParams = createLoader(searchParamsConfig )

// Expected:
const { count, contributors } = loadSearchParams(request, { strict: true })
//      count: number

Activity

  1. changed the title [-]Narrow type in strict mode[/-] [+]Required option for query params[/+] on May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions