github.com/MontFerret/ferret@v0.18.0/pkg/stdlib/types/is_string.go (about) 1 package types 2 3 import ( 4 "context" 5 6 "github.com/MontFerret/ferret/pkg/runtime/core" 7 "github.com/MontFerret/ferret/pkg/runtime/values" 8 "github.com/MontFerret/ferret/pkg/runtime/values/types" 9 ) 10 11 // IS_STRING checks whether value is a string value. 12 // @param {Any} value - Input value of arbitrary type. 13 // @return {Boolean} - Returns true if value is string, otherwise false. 14 func IsString(_ context.Context, args ...core.Value) (core.Value, error) { 15 err := core.ValidateArgs(args, 1, 1) 16 17 if err != nil { 18 return values.None, err 19 } 20 21 return isTypeof(args[0], types.String), nil 22 }