Skip to content

Conversation

@EskiMojo14
Copy link
Member

fixes #1089

@vercel
Copy link

vercel bot commented May 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
valibot ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 26, 2025 8:33pm

@EskiMojo14
Copy link
Member Author

EskiMojo14 commented May 25, 2025

image

leaving this as draft now as i can't work out how to allow type guards that accept wider types than the current pipe type

edit: switching back to the previous overloads half fixes the issue - it's now complaining when the output type is wider than the input type
image

@fabian-hiller fabian-hiller self-requested a review May 26, 2025 01:12
@fabian-hiller fabian-hiller self-assigned this May 26, 2025
@fabian-hiller fabian-hiller added the enhancement New feature or request label May 26, 2025
@fabian-hiller fabian-hiller added this to the v1.2 milestone May 26, 2025
@fabian-hiller fabian-hiller requested a review from Copilot May 26, 2025 01:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new guard action and corresponding type definitions to enable narrowing using type predicates in the transformation framework. Key changes include:

  • Adding new API links and documentation for the guard action in markdown files.
  • Defining and exporting new types and properties for GuardIssue and GuardAction across the API and type folders.
  • Implementing the guard function in the library with associated tests covering functionality and type inference.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
website/src/routes/api/menu.md Added menu links for guard and its related issues/actions.
website/src/routes/api/(types)/GuardIssue/* Introduced new property definitions and documentation for GuardIssue.
website/src/routes/api/(types)/GuardAction/* Added type properties and documentation for GuardAction.
website/src/routes/api/(actions)/guard/* Created properties and docs for the guard action along with usage examples.
library/src/actions/guard/* Implemented the guard function, interfaces, and tests ensuring correct behavior and type inference.

@pkg-pr-new
Copy link

pkg-pr-new bot commented May 26, 2025

Open in StackBlitz

npm i https://pkg.pr.new/valibot@1204

commit: d4f4300

@fabian-hiller
Copy link
Member

Thank you for working on this! I plan it for our v1.2 release. Feel free to mark it as ready once you are done. After that I will take over, review everything and merge it.

@EskiMojo14 EskiMojo14 marked this pull request as ready for review May 26, 2025 20:31
@EskiMojo14
Copy link
Member Author

EskiMojo14 commented May 26, 2025

found a fix (involving lots of any, unfortunately, though only in positions where a more specific type will be kept later) - should be ready for review :)

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fabian-hiller fabian-hiller modified the milestones: v1.2, v1.3 Nov 23, 2025
@vercel
Copy link

vercel bot commented Jan 8, 2026

@fabian-hiller is attempting to deploy a commit to the Open Circle Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Jan 8, 2026
@fabian-hiller
Copy link
Member

This PR should be ready now. I will merge it soon.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 101 out of 101 changed files in this pull request and generated 1 comment.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jan 10, 2026
@fabian-hiller fabian-hiller merged commit b507228 into open-circle:main Jan 10, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check action to infer return type from a passed typeguard

2 participants