Skip to content

parseBigInt()

ts
function parseBigInt(data): ParseFailure | ParseSuccess<bigint>

Parse bigint

Parameters

ParameterTypeDescription
dataunknowndata to be validated

Returns

ParseFailure | ParseSuccess<bigint>

Examples

ts
parseBigInt(0n) // => ParseSuccess<bigint>
ts
parseBigInt(0) // => ParseFailure

parseBoolean()

ts
function parseBoolean(data): ParseFailure | ParseSuccess<boolean>

Parse boolean

Parameters

ParameterTypeDescription
dataunknowndata to be validated

Returns

ParseFailure | ParseSuccess<boolean>

Examples

ts
parseBoolean(true) // => ParseSuccess<boolean>
ts
parseBoolean(false) // => ParseSuccess<boolean>
ts
parseBoolean(0) // => ParseFailure

parseNull()

ts
function parseNull(data): ParseFailure | ParseSuccess<null>

Parse null

Parameters

ParameterTypeDescription
dataunknowndata to be validated

Returns

ParseFailure | ParseSuccess<null>

Examples

ts
parseNull(null) // => ParseSuccess<null>
ts
parseNull(undefined) // => ParseFailure

parseNumber()

ts
function parseNumber(data): ParseFailure | ParseSuccess<number>

Parse number

Parameters

ParameterTypeDescription
dataunknowndata to be validated

Returns

ParseFailure | ParseSuccess<number>

Examples

ts
parseNumber(0) // => ParseSuccess<number>
ts
parseNumber('0') // => ParseFailure

parseString()

ts
function parseString(data): ParseFailure | ParseSuccess<string>

Parse string

Parameters

ParameterTypeDescription
dataunknowndata to be validated

Returns

ParseFailure | ParseSuccess<string>

Examples

ts
parseString('abc') // => ParseSuccess<string>
ts
parseString(0) // => ParseFailure

parseSymbol()

ts
function parseSymbol(data): ParseFailure | ParseSuccess<symbol>

Parse symbol

Parameters

ParameterTypeDescription
dataunknowndata to be validated

Returns

ParseFailure | ParseSuccess<symbol>

Examples

ts
parseSymbol(Symbol('abc')) // => ParseSuccess<symbol>
ts
parseSymbol('abc') // => ParseFailure

parseUndefined()

ts
function parseUndefined(data): ParseFailure | ParseSuccess<undefined>

Parse undefined

Example

ts
parseUndefined(undefined) // => ParseSuccess<undefined>
parseUndefined(null) // => ParseFailure

Parameters

ParameterTypeDescription
dataunknowndata to be validated

Returns

ParseFailure | ParseSuccess<undefined>