New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nuqs

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuqs - npm Package Compare versions

Comparing version 1.17.8 to 1.18.0

dist/serializer-D6QaciYt.d.cts

4

dist/index.d.ts

@@ -1,3 +0,3 @@

import { P as Parser, a as ParserBuilder, p as parseAsStringEnum, b as parseAsJson, c as parseAsArrayOf, O as Options, N as Nullable } from './serializer-C_l8WgvO.js';
export { H as HistoryOptions, e as createParser, d as createSerializer, j as parseAsBoolean, i as parseAsFloat, h as parseAsHex, g as parseAsInteger, l as parseAsIsoDateTime, n as parseAsNumberLiteral, f as parseAsString, m as parseAsStringLiteral, k as parseAsTimestamp } from './serializer-C_l8WgvO.js';
import { P as Parser, a as ParserBuilder, p as parseAsStringEnum, b as parseAsJson, c as parseAsArrayOf, O as Options, N as Nullable } from './serializer-D6QaciYt.js';
export { H as HistoryOptions, e as createParser, d as createSerializer, o as inferParserType, j as parseAsBoolean, i as parseAsFloat, h as parseAsHex, g as parseAsInteger, l as parseAsIsoDateTime, n as parseAsNumberLiteral, f as parseAsString, m as parseAsStringLiteral, k as parseAsTimestamp } from './serializer-D6QaciYt.js';
import 'react';

@@ -4,0 +4,0 @@

@@ -227,3 +227,3 @@ import { getDefaultThrottle, error, debug, parseAsString, parseAsInteger, parseAsFloat, parseAsBoolean, parseAsTimestamp, parseAsIsoDateTime, parseAsStringEnum, parseAsJson, parseAsArrayOf, safeParse, renderQueryString } from './chunk-LOUAWQHU.js';

function patchHistory() {
const version = "1.17.8";
const version = "1.18.0";
const patched = history.__nuqs_patched;

@@ -230,0 +230,0 @@ if (patched) {

@@ -1,3 +0,3 @@

import { a as ParserBuilder } from './serializer-C_l8WgvO.js';
export { P as Parser, e as createParser, d as createSerializer, c as parseAsArrayOf, j as parseAsBoolean, i as parseAsFloat, h as parseAsHex, g as parseAsInteger, l as parseAsIsoDateTime, b as parseAsJson, n as parseAsNumberLiteral, f as parseAsString, p as parseAsStringEnum, m as parseAsStringLiteral, k as parseAsTimestamp } from './serializer-C_l8WgvO.js';
import { a as ParserBuilder } from './serializer-D6QaciYt.js';
export { P as Parser, e as createParser, d as createSerializer, o as inferParserType, c as parseAsArrayOf, j as parseAsBoolean, i as parseAsFloat, h as parseAsHex, g as parseAsInteger, l as parseAsIsoDateTime, b as parseAsJson, n as parseAsNumberLiteral, f as parseAsString, p as parseAsStringEnum, m as parseAsStringLiteral, k as parseAsTimestamp } from './serializer-D6QaciYt.js';
import 'react';

@@ -4,0 +4,0 @@

export { SearchParams, createSearchParamsCache } from './parsers.js';
export { P as Parser, a as ParserBuilder, e as createParser, d as createSerializer, c as parseAsArrayOf, j as parseAsBoolean, i as parseAsFloat, h as parseAsHex, g as parseAsInteger, l as parseAsIsoDateTime, b as parseAsJson, n as parseAsNumberLiteral, f as parseAsString, p as parseAsStringEnum, m as parseAsStringLiteral, k as parseAsTimestamp } from './serializer-C_l8WgvO.js';
export { P as Parser, a as ParserBuilder, e as createParser, d as createSerializer, o as inferParserType, c as parseAsArrayOf, j as parseAsBoolean, i as parseAsFloat, h as parseAsHex, g as parseAsInteger, l as parseAsIsoDateTime, b as parseAsJson, n as parseAsNumberLiteral, f as parseAsString, p as parseAsStringEnum, m as parseAsStringLiteral, k as parseAsTimestamp } from './serializer-D6QaciYt.js';
import 'react';
{
"name": "nuqs",
"version": "1.17.8",
"version": "1.18.0",
"description": "Type-safe search params state manager for Next.js - Like React.useState, but stored in the URL query string",

@@ -82,2 +82,3 @@ "license": "MIT",

"size-limit": "^11.1.2",
"tsafe": "^1.7.2",
"tsd": "^0.30.7",

@@ -84,0 +85,0 @@ "tsup": "^8.0.2",

@@ -687,2 +687,33 @@ # useQueryState for Next.js

## Parser type inference
To access the underlying type returned by a parser, you can use the
`inferParserType` type helper:
```ts
import { parseAsInteger, type inferParserType } from 'nuqs' // or 'nuqs/server'
const intNullable = parseAsInteger
const intNonNull = parseAsInteger.withDefault(0)
inferParserType<typeof intNullable> // number | null
inferParserType<typeof intNonNull> // number
```
For an object describing parsers (that you'd pass to `createSearchParamsCache`
or to `useQueryStates`, `inferParserType` will
return the type of the object with the parsers replaced by their inferred types:
```ts
import { parseAsBoolean, parseAsInteger, type inferParserType } from 'nuqs' // or 'nuqs/server'
const parsers = {
a: parseAsInteger,
b: parseAsBoolean.withDefault(false)
}
inferParserType<typeof parsers>
// { a: number | null, b: boolean }
```
## Testing

@@ -689,0 +720,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc