GuobaGuoba Utils

isString

@guoba-ai/utils / guard / isString

Function: isString()

function isString(val): val is string;

Defined in: guard.ts:12

Check if a value is a string.

Parameters

val

unknown

The value to check

Returns

val is string

true if the value is a string

Example

isString('hello') // true
isString(123) // false

On this page