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
| Parameter | Type | Description |
|---|---|---|
| type | DataType | (Optional) the datatype to interpret as |
| hints | TypeHints | (Optional) type hinting information |
| subtype | DataType | (Optional) the subtype of the datatype (i.e., if the main type is an array) |
Returns:
Value
A parsed value