Search


Search something to see results

unsafeParse

Type Parameters

  • T
  • Input = unknown

Parameters

Returns T

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[]
}