Function isNumber

  • Validate a number

    Parameters

    • input: unknown

      The raw input

    Returns Validated<number>

    Example

    isNumber(1) >>
    {
    valid: true,
    parsed: 1,
    };

    isNumber("") >>
    {
    valid: false,
    error: 'Not a number: ""',
    };