@ethereumjs/util / toType
Coerce an input value to a selected output representation.
toType<
T>(input,outputType):null
Defined in: packages/util/src/types.ts:81
Convert an input to a specified type. Input of null/undefined returns null/undefined regardless of the output type.
T extends TypeOutput
null
value to convert
T
type to output
null
toType<
T>(input,outputType):undefined
Defined in: packages/util/src/types.ts:83
Coerce an input value to a selected output representation.
T extends TypeOutput
undefined
T
undefined
toType<
T>(input,outputType):TypeOutputReturnType[T]
Defined in: packages/util/src/types.ts:85
Coerce an input value to a selected output representation.
T extends TypeOutput
T