Search


Search something to see results

failure

Parameters

  • context: ParseContext
  • schemaName: string
  • input: unknown
  • Optionalrefinement: string

Returns Failure

import * as x from 'unhoax'

const customSchema: x.Schema<string> = {
name: 'myType',
parse: (input, context = createParseContext('myType', input)) => {
if (typeof input === 'string') return x.success(context, input)
else return x.failure(context, 'myType', input)
}
}