Repository navigation
Support v.function() validators - #182
Merged
Merged
Conversation
reeceyang
force-pushed
the
ry/function-validator
branch
from
November 20, 2026 23:42
ddf2261 to
5ceae06
Compare
commit: |
reeceyang
marked this pull request as ready for review
November 20, 2026 23:50
reeceyang
force-pushed
the
ry/function-validator
branch
from
November 20, 2026 23:50
5ceae06 to
a814254
Compare
reeceyang
force-pushed
the
ry/function-validator
branch
from
November 20, 2026 23:52
a814254 to
8447259
Compare
Contributor
There was a problem hiding this comment.
1 issue found and verified against the latest diff
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="index.ts">
<violation number="1" location="index.ts:1431">
P2: This accepts malformed function handles such as `function://bad`, which later cannot be parsed by `parseFunctionHandle`; validate the complete `function://<component>;<udf>` shape rather than only checking the prefix.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| return; | ||
| } | ||
| case "function": { | ||
| if (typeof value !== "string" || !value.startsWith("function://")) { |
Contributor
There was a problem hiding this comment.
P2: This accepts malformed function handles such as function://bad, which later cannot be parsed by parseFunctionHandle; validate the complete function://<component>;<udf> shape rather than only checking the prefix.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At index.ts, line 1431:
<comment>This accepts malformed function handles such as `function://bad`, which later cannot be parsed by `parseFunctionHandle`; validate the complete `function://<component>;<udf>` shape rather than only checking the prefix.</comment>
<file context>
@@ -1426,6 +1427,14 @@ function validateValidator(validator: ValidatorJSON, value: any) {
return;
}
+ case "function": {
+ if (typeof value !== "string" || !value.startsWith("function://")) {
+ throw new Error(
+ `Validator error: Expected \`v.function()\`, got \`${value}\``,
</file context>
Suggested change
| if (typeof value !== "string" || !value.startsWith("function://")) { | |
| if ( | |
| typeof value !== "string" || | |
| !/^function:\/\/[^;]*;[^;]+$/.test(value) | |
| ) { |
ianmacartney
approved these changes
Nov 21, 2026
Merged
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.
Support v.function().
🤖 Generated with Claude Code