Function isValidIsoString

  • Checks if the input is a valid UTC ISO string and type guards the input.

    Parameters

    • input: unknown

    Returns input is `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z`

    import {isValidIsoString} from 'date-vir';

    isValidIsoString('no'); // `false`
    isValidIsoString('2024-05-01T20:18:17.123Z'); // `true`