utils.go: added IsBool() and IsFract()
This commit is contained in:
parent
c3198e4c79
commit
9c2eca40d7
10
utils.go
10
utils.go
@ -24,6 +24,11 @@ func IsFloat(v any) (ok bool) {
|
|||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func IsBool(v any) (ok bool) {
|
||||||
|
_, ok = v.(bool)
|
||||||
|
return ok
|
||||||
|
}
|
||||||
|
|
||||||
func IsList(v any) (ok bool) {
|
func IsList(v any) (ok bool) {
|
||||||
_, ok = v.(*ListType)
|
_, ok = v.(*ListType)
|
||||||
return ok
|
return ok
|
||||||
@ -34,6 +39,11 @@ func IsDict(v any) (ok bool) {
|
|||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func IsFract(v any) (ok bool) {
|
||||||
|
_, ok = v.(*fraction)
|
||||||
|
return ok
|
||||||
|
}
|
||||||
|
|
||||||
func IsNumber(v any) (ok bool) {
|
func IsNumber(v any) (ok bool) {
|
||||||
return IsFloat(v) || IsInteger(v)
|
return IsFloat(v) || IsInteger(v)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user