feat(rules.on): support route directive

This commit is contained in:
yusing
2025-05-05 19:34:24 +08:00
parent 7b0ed09772
commit f190483b4e
3 changed files with 59 additions and 0 deletions

View File

@@ -30,6 +30,13 @@ func (t *Tuple[T1, T2]) String() string {
return fmt.Sprintf("%v:%v", t.First, t.Second)
}
func validateSingleArg(args []string) (any, gperr.Error) {
if len(args) != 1 {
return nil, ErrExpectOneArg
}
return args[0], nil
}
// toStrTuple returns *StrTuple.
func toStrTuple(args []string) (any, gperr.Error) {
if len(args) != 2 {