Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 380 Bytes

File metadata and controls

12 lines (9 loc) · 380 Bytes

The parseAsTuple parser allows you to parse fixed-length tuples with any type for each position.

import { parseAsTuple } from '@/lib/parsers/parse-as-tuple'
import { parseAsInteger } from 'nuqs'

// Coordinates tuple (x, y)
parseAsTuple([parseAsInteger, parseAsInteger])

// Optionally, customise the separator
parseAsTuple([parseAsInteger, parseAsInteger], ';')