-
-
Notifications
You must be signed in to change notification settings - Fork 0
string
Nicholas Berlette edited this page Jun 19, 2025
·
1 revision
function isString(it: unknown): it is string;
Checks if the given value is a string.
Name | Info |
---|---|
it |
The value to check. |
true
if the value is a string, false
otherwise.
Primitives
import { isString } from "jsr:@nick/is/string";
const x: unknown = "hello";
if (isString(x)) {
console.log(x.toUpperCase());
// ^? const x: string
}