ethereumjs-monorepo

@ethereumjs/util


@ethereumjs/util / toType

Function: toType()

Call Signature

toType<T>(input, outputType): null

Defined in: packages/util/src/types.ts:83

Convert an input to a specified type. Input of null/undefined returns null/undefined regardless of the output type.

Type Parameters

T

T extends TypeOutput

Parameters

input

null

value to convert

outputType

T

type to output

Returns

null

Call Signature

toType<T>(input, outputType): undefined

Defined in: packages/util/src/types.ts:84

Convert an input to a specified type. Input of null/undefined returns null/undefined regardless of the output type.

Type Parameters

T

T extends TypeOutput

Parameters

input

undefined

value to convert

outputType

T

type to output

Returns

undefined

Call Signature

toType<T>(input, outputType): TypeOutputReturnType[T]

Defined in: packages/util/src/types.ts:85

Convert an input to a specified type. Input of null/undefined returns null/undefined regardless of the output type.

Type Parameters

T

T extends TypeOutput

Parameters

input

ToBytesInputTypes

value to convert

outputType

T

type to output

Returns

TypeOutputReturnType[T]