isString

A TypeScript type guard that checks whether a value is a string, narrowing the type so string methods can be used safely in your code.

Usage

Check whether a value is a string. This is a TypeScript type guard function.

import { isString } from '@movk/core'

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

API

isString(value: any): value is string

Parameters

value
any required
The value to check.

Returns

boolean
Returns true if the value is a string, otherwise false.

Changelog

No recent changes
Copyright © 2024 - 2026 YiXuan - MIT License