Some data-type check functions (e.g. IsInteger()) exported
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user