-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
fix: avoid complex values default being overriden on write #89
Conversation
🦋 Changeset detectedLatest commit: ae3d890 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for sveltekit-search-params ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
WalkthroughThis update enhances the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SvelteComponent
participant SearchParams
User->>SvelteComponent: Input data
SvelteComponent->>SearchParams: Update query parameters
SearchParams->>SvelteComponent: Return updated parameters
SvelteComponent->>User: Display updated parameters
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (5)
- .changeset/twelve-weeks-drive.md (1 hunks)
- playground/src/routes/default/obj/+page.svelte (1 hunks)
- playground/src/routes/default/parameters-obj/+page.svelte (1 hunks)
- src/lib/sveltekit-search-params.ts (2 hunks)
- tests/index.test.ts (1 hunks)
Additional comments not posted (11)
.changeset/twelve-weeks-drive.md (1)
1-5
: LGTM!The changeset entry correctly specifies a patch update and provides a clear description of the fix.
playground/src/routes/default/obj/+page.svelte (2)
1-5
: LGTM!The code correctly imports necessary functions and defines a query parameter with a default value.
6-11
: LGTM!The code correctly binds the input value to the query parameter and includes a link to reset the parameters.
playground/src/routes/default/parameters-obj/+page.svelte (2)
1-5
: LGTM!The code correctly imports necessary functions and defines a query parameter with a default value.
6-11
: LGTM!The code correctly binds the input value to the query parameter and includes a link to reset the parameters.
src/lib/sveltekit-search-params.ts (4)
284-284
: Good use ofstructuredClone
forvalueToSet
.The use of
structuredClone
ensures that a deep copy of the values is passed, preventing unintended mutations and maintaining data integrity.
290-290
: Good use ofstructuredClone
forvalueToSet
.The use of
structuredClone
ensures that a deep copy of the values is passed, preventing unintended mutations and maintaining data integrity.
392-392
: Good use ofstructuredClone
fordefaultValue
.The use of
structuredClone
ensures that a deep copy of the values is passed, preventing unintended mutations and maintaining data integrity.
398-398
: Good use ofstructuredClone
fordefaultValue
.The use of
structuredClone
ensures that a deep copy of the values is passed, preventing unintended mutations and maintaining data integrity.tests/index.test.ts (2)
385-395
: Test case for verifying default values for complex objects.The test case ensures that the
obj
parameter retains its default value after the input field is filled and the link is clicked. This verifies the correct behavior of the fix.
397-407
: Test case for verifying default values for complex objects withqueryParameters
.The test case ensures that the
obj
parameter retains its default value after the input field is filled and the link is clicked. This verifies the correct behavior of the fix.
Closes #86
Summary by CodeRabbit