Skip to content

fix return type validators#3

Merged
ldanilek merged 3 commits intomainfrom
lee/return-types
Mar 19, 2025
Merged

fix return type validators#3
ldanilek merged 3 commits intomainfrom
lee/return-types

Conversation

@ldanilek
Copy link
Contributor


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ldanilek ldanilek requested a review from ianmacartney March 13, 2025 14:35
Comment on lines +88 to +96
function paginationResultValidator<T>(itemValidator: Validator<T, "required", string>) {
return v.object({
continueCursor: v.string(),
isDone: v.boolean(),
page: v.array(itemValidator),
pageStatus: v.optional(v.union(v.null(), v.literal("SplitRequired"), v.literal("SplitRecommended"))),
splitCursor: v.optional(v.union(v.null(), v.string())),
});
}
Copy link
Member

Choose a reason for hiding this comment

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

This would be great for convex-helpers!

ldanilek and others added 2 commits March 13, 2025 16:38
Co-authored-by: Ian Macartney <ian@convex.dev>
Co-authored-by: Ian Macartney <ian@convex.dev>
};

export type OpaqueIds<T> = T extends GenericId<infer _T> | string
export type OpaqueIds<T> = T extends GenericId<infer _T>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

btw this is a really important part of the change get-convex/templates#38

@ldanilek ldanilek merged commit 0f3a602 into main Mar 19, 2025
1 check passed
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.

2 participants