Function isInteger

  • Validate an integer

    Parameters

    • input: unknown

      The raw input

    Returns Validated<number>

    Example

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

    isInteger(0.5) >>
    {
    valid: false,
    error: "Not an integer: 0.5",
    };