• Validates user input for adding a new user.

    Parameters

    • userName: string
    • existingUsers: string[]

      A list of existing usernames.

    Returns null | string

    • Errors object, empty if valid.