Skip to content

@jsvision/datagrid / PARSE_FAILED

Variable: PARSE_FAILED

const PARSE_FAILED: unique symbol

Defined in: datagrid/src/format.ts:32

The sentinel an inverse parse returns for a string it cannot convert — distinct from a valid value and from NaN, so the commit path can reject an unparseable edit instead of writing garbage.

Example

ts
import { fmt, PARSE_FAILED } from '@jsvision/datagrid';
const money = fmt.currency({ locale: 'en-US', currency: 'USD' });
const v = money.parse('not a number');
if (v === PARSE_FAILED) { /* keep the editor open, write nothing */ }