Here is a function which accepts 'value' and returns a true and false based on the fact its number or not. But it accepts '1....2' too and returns true which is a problem. I am confused on how to deal with it.
const boolean = (value, schema) => {
return (
value === false ||
value === true ||
value === "true" ||
value === "false" ||
value === "0" ||
value === "1"
);
};
const float = (value, schema) => {
return !isNaN(parseFloat(value));
};
boolean('1....2')
isfalse
?schema
parameter?