Skip to content

chore(Arktype): Upgrade arktype to 2.0#15

Merged
jhechtf merged 1 commit intomainfrom
feat/upgrade-arktype-utils-to-v2
Feb 8, 2025
Merged

chore(Arktype): Upgrade arktype to 2.0#15
jhechtf merged 1 commit intomainfrom
feat/upgrade-arktype-utils-to-v2

Conversation

@jhechtf
Copy link
Copy Markdown
Owner

@jhechtf jhechtf commented Feb 7, 2025

TL;DR

Updated arktype dependency to v2.0.4 and refactored validation logic to handle the new error handling approach.

What changed?

  • Upgraded arktype from v1.0.28-alpha to v2.0.4
  • Enhanced formDataToObject to handle specified array indices and object keys
  • Updated validation logic to use arktype's new error handling system
  • Added new test cases for array and object handling in FormData
  • Added eslint rule to limit static destructure depth

How to test?

  1. Run the test suite with pnpm test
  2. Test FormData validation with arrays using specified indices:
const fd = new FormData();
fd.append('names[0]', 'bob');
fd.append('names[2]', 'joe');
fd.append('names[1]', 'rob');
  1. Test FormData validation with object keys:
const fd = new FormData();
fd.append('locations[london]', '24');
fd.append('locations[new_york]', '77');

Why make this change?

The update to arktype v2.0.4 provides improved type validation and error handling. The enhanced FormData handling allows for more flexible data structures when working with form submissions, supporting both indexed arrays and object key-value pairs.

Copy link
Copy Markdown
Owner Author

jhechtf commented Feb 7, 2025

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 7, 2025

🦋 Changeset detected

Latest commit: e3b452e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@jhecht/arktype-utils Major

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

@jhechtf jhechtf marked this pull request as ready for review February 7, 2025 23:54
@jhechtf jhechtf force-pushed the feat/upgrade-arktype-utils-to-v2 branch 7 times, most recently from 94735d6 to 280f7d5 Compare February 8, 2025 05:40
Copy link
Copy Markdown
Owner Author

jhechtf commented Feb 8, 2025

Merge activity

  • Feb 8, 1:04 AM EST: A user started a stack merge that includes this pull request via Graphite.
  • Feb 8, 1:05 AM EST: Graphite rebased this pull request as part of a merge.
  • Feb 8, 1:07 AM EST: A user merged this pull request with Graphite.

@jhechtf jhechtf changed the base branch from feat/update-formdata-for-nested-objects to graphite-base/15 February 8, 2025 06:04
@jhechtf jhechtf changed the base branch from graphite-base/15 to main February 8, 2025 06:04
@jhechtf jhechtf force-pushed the feat/upgrade-arktype-utils-to-v2 branch from 280f7d5 to e3b452e Compare February 8, 2025 06:05
@jhechtf jhechtf merged commit c2196c0 into main Feb 8, 2025
@jhechtf jhechtf deleted the feat/upgrade-arktype-utils-to-v2 branch February 8, 2025 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant