unsafeParse<T, Input = unknown>(schema: Schema<T, Input>, input: Input): T
schema: Schema<T, Input>
input: Input
import * as x from 'unhoax'const result = x.unsafeParse(x.string, 'hello')result // 'hello'try { x.unsafeParse(x.number, 'hello')} catch (error) { error // Error error.cause // x.ParseError error.cause.issues // x.ParseIssue[]} Copy
import * as x from 'unhoax'const result = x.unsafeParse(x.string, 'hello')result // 'hello'try { x.unsafeParse(x.number, 'hello')} catch (error) { error // Error error.cause // x.ParseError error.cause.issues // x.ParseIssue[]}
Example