Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package rulekit
import (
"fmt"
"regexp"
"strconv"

"github.com/qpoint-io/rulekit/set"
)
Expand Down Expand Up @@ -178,6 +179,18 @@ func (n *nodeMatch) apply(lv any, rv any) bool {
return true
}
}
case int:
return r.MatchString(strconv.Itoa(val))
case int64:
return r.MatchString(strconv.FormatInt(val, 10))
case uint:
return r.MatchString(strconv.FormatUint(uint64(val), 10))
case uint64:
return r.MatchString(strconv.FormatUint(val, 10))
case float32:
return r.MatchString(strconv.FormatFloat(float64(val), 'f', -1, 32))
case float64:
return r.MatchString(strconv.FormatFloat(val, 'f', -1, 64))
}
return false
}
Expand Down