observablehq/stdlib

Add integer to condition to getTypeValidator

mkfreeman opened this issue · 0 comments

The getTypeValidator function doesn't have a case for integer. As a result, invalid results are formatted in the same way as valid integers. Perhaps:

const isValidInteger = (value) =>  Number.isInteger(value) && !Number.isNaN(value);

Screen Shot 2023-02-03 at 11 20 36 AM