tables.coerce.md
January 18, 2023 ยท View on GitHub
Home > @datashaper/tables > coerce
coerce() function
Ensure an incoming value matches its datatype. For example, if user input is from a textfield, parse it.
Signature:
export declare function coerce(value: Value, dataType: DataType): Value;
Parameters
| Parameter | Type | Description |
|---|---|---|
| value | Value | |
| dataType | DataType |
Returns:
Value