feat(data-schema): add Schema.transform()#11234
Merged
mjackson merged 4 commits intoremix-run:mainfrom Apr 25, 2026
Merged
Conversation
…formation Signed-off-by: Logan McAnsh <logan@mcan.sh>
Signed-off-by: Logan McAnsh <logan@mcan.sh>
.transformThere was a problem hiding this comment.
Pull request overview
This PR adds a Schema.transform(...) modifier to data-schema so consumers can map a successfully-validated output value into a new output type, and introduces tests covering transform behavior and chaining with other modifiers.
Changes:
- Added a new
transformmethod to theSchemachainable API and itscreateSchemaimplementation. - Added tests for
transform, including chaining order withrefine.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/data-schema/src/lib/schema.ts | Adds Schema.transform typing + implementation to map validated output to a new output type. |
| packages/data-schema/src/lib/schema.test.ts | Adds test cases validating transform behavior and chaining with existing modifiers. |
…ests Signed-off-by: Logan McAnsh <logan@mcan.sh>
Member
|
thanks for the PR, @mcansh! 💪 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add
Schema.transform()to thedata-schemachainable API so schemas can map a successfully validated output value into a new output value and type.@remix-run/data-schema.