generated from chiffre-io/template-library
-
-
Notifications
You must be signed in to change notification settings - Fork 221
feat: multi-parsers #1134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat: multi-parsers #1134
Changes from 5 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
e8af136
feat: multi-parsers
TkDodo db3c11e
chore: increase size limit
TkDodo 2fd2a23
fix: read is too broad for useQueryStates
TkDodo 44820f5
ref: remove read abstraction
TkDodo d8e26a9
ref: bump size limit some more
TkDodo bc9786d
test: add some tests for parseAsNativeArray
TkDodo d622cea
test: native-array e2e tests
TkDodo 6c95153
fix: return null from parsing if everything is unparsable
TkDodo 864e0cd
test: add withDefault([]) to parseAsNativeArrayOf in
TkDodo c8da7d1
ref: type guard
TkDodo effb49c
ref: use object.entries over object.keys with an indexed access and a…
TkDodo ff10737
ref: rename isEmpty to avoid ambiguity
TkDodo e0021b1
fix: compareQuery for iterables
TkDodo cc89e20
fix: explicitly set searchParam to empty string if we get an empty it…
TkDodo 27a354a
test: fix wrong parser assumptions
TkDodo c38d780
fix: switch to comparing all values in key-isolation
TkDodo c1f2ef9
Merge branch 'next' into feature/multi-parsers
TkDodo 6f01b4d
fix: defensive check for standard schema
TkDodo ef68422
Update packages/nuqs/src/lib/search-params.ts
TkDodo 8e4ebf4
feat: add .withDefault([]) to parseAsNativeArrayOf
TkDodo 0be1405
ref: rename defaultValue to fallbackValue
TkDodo 0411386
chore: leave a comment about the special empty value set
TkDodo c0b9677
Merge branch 'next' into feature/multi-parsers
TkDodo f036840
fix: types for parseAsNativeArray
TkDodo f5bf1b8
test: compare tests
TkDodo 6b14b75
fix: keep backwards compatibility for Parser / ParserBuilder
TkDodo 8fcd61b
doc: parseAsNativeArrayOf
TkDodo 976aeb9
ref: move away from Iterables towards Arrays
TkDodo 79f4249
fix: compare tests
TkDodo 660af9d
doc: createMultiParser demo
TkDodo 0622d04
Update packages/docs/content/docs/parsers/built-in.mdx
TkDodo 4bf2ea2
doc: align clear button
TkDodo 7013a5a
fix: NaN
TkDodo 9f42bfc
doc: show values
TkDodo b0a2277
doc: simplify example
TkDodo fb185ce
doc: styles & wording for native arrays section & demo
franky47 11d8951
doc: add block about equality function
franky47 c9060e6
doc: custom multiparsers wording & demo
franky47 dfd874f
ref: rename QueryParam type to Query
franky47 551131b
ref: import type
franky47 f149875
feat: handle multi parsers in bijectivity testing helpers
franky47 875beaf
doc: mark MultiParser's parseServerSide as deprecated
franky47 805ed6a
chore: allow a bit more headroom on the server bundle
franky47 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -207,7 +207,7 @@ | |
| { | ||
| "name": "Server", | ||
| "path": "dist/server.js", | ||
| "limit": "3 kB" | ||
| "limit": "3.1 kB" | ||
| } | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| export function isEmpty(query: string | Iterable<string> | null): boolean { | ||
| return query === null || (Array.isArray(query) && query.length === 0) | ||
| } | ||
|
|
||
| export function write( | ||
| serialized: Iterable<string>, | ||
| key: string, | ||
| searchParams: URLSearchParams | ||
| ): URLSearchParams { | ||
| if (typeof serialized === 'string') { | ||
| searchParams.set(key, serialized) | ||
| } else { | ||
| searchParams.delete(key) | ||
| for (const v of serialized) { | ||
| searchParams.append(key, v) | ||
| } | ||
| } | ||
| return searchParams | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.