Some data-type check functions (e.g. IsInteger()) exported

This commit is contained in:
2024-05-08 07:53:01 +02:00
parent b2b0bb04c5
commit 8ee0bb5701
13 changed files with 44 additions and 44 deletions
+9 -9
View File
@@ -9,41 +9,41 @@ import (
"reflect"
)
func isString(v any) (ok bool) {
func IsString(v any) (ok bool) {
_, ok = v.(string)
return ok
}
func isInteger(v any) (ok bool) {
func IsInteger(v any) (ok bool) {
_, ok = v.(int64)
return ok
}
func isFloat(v any) (ok bool) {
func IsFloat(v any) (ok bool) {
_, ok = v.(float64)
return ok
}
func isList(v any) (ok bool) {
func IsList(v any) (ok bool) {
_, ok = v.(*ListType)
return ok
}
func isDict(v any) (ok bool) {
func IsDict(v any) (ok bool) {
_, ok = v.(map[any]any)
return ok
}
func isNumber(v any) (ok bool) {
return isFloat(v) || isInteger(v)
func IsNumber(v any) (ok bool) {
return IsFloat(v) || IsInteger(v)
}
func isNumOrFract(v any) (ok bool) {
return isFloat(v) || isInteger(v) || isFraction(v)
return IsFloat(v) || IsInteger(v) || isFraction(v)
}
func isNumberString(v any) (ok bool) {
return isString(v) || isNumber(v)
return IsString(v) || IsNumber(v)
}
func isFunctor(v any) (ok bool) {