Const
The string schema validates that the input is a string value.
string
import { string } from "typerun/schema";import { is } from "typerun";if (is(string)("hello")) { console.log(`"hello" is a string`);}if (!is(string)(undefined)) { console.log("undefined is not a string");} Copy
import { string } from "typerun/schema";import { is } from "typerun";if (is(string)("hello")) { console.log(`"hello" is a string`);}if (!is(string)(undefined)) { console.log("undefined is not a string");}
The
string
schema validates that the input is a string value.Example