Function isTimestampExpired

  • Validates if a timestamp string is expired

    This function parses a timestamp string (typically from JWT tokens) and checks if it represents a time that has already passed.

    Parameters

    • timestamp: string

      The timestamp string to validate (e.g., '1754078962511')

    Returns boolean

    True if the timestamp is in the past (expired), false otherwise

    isTimestampExpired('1754078962511'); // true if current time > 1754078962511
    isTimestampExpired('9999999999999'); // false (future timestamp)
    isTimestampExpired(''); // false (invalid timestamp)