tables.parseas.md

May 8, 2024 ยท View on GitHub

Home > @datashaper/tables > parseAs

parseAs() function

Factory function to create a value parser based on defined data type and type hints

Signature:

export declare function parseAs(type?: DataType, hints?: TypeHints, subtype?: DataType): Value;

Parameters

ParameterTypeDescription
typeDataType(Optional) the datatype to interpret as
hintsTypeHints(Optional) type hinting information
subtypeDataType(Optional) the subtype of the datatype (i.e., if the main type is an array)

Returns:

Value

A parsed value