PenaltyBox.prototype.has
Add an entry
into the PenaltyBox for the duration of the given timeToLive
.
Syntax
add(entry, timeToLive)
Parameters
entry
: string- The name of the entry to look up
timeToLive
: number- In minutes, how long the entry should be added into the PenaltyBox
- Valid
timeToLive
is 1 minute to 60 minutes andtimeToLive
value is truncated to the nearest minute.
Return value
Returns undefined
.
Exceptions
TypeError
- Thrown if the provided
entry
value can not be coerced into a string - Thrown if the provided
timeToLive
value is not either, a number between 1 and 60 inclusively.
- Thrown if the provided