function ensureInSetTimeoutLimit(timeoutInMilliseconds) {
  if (timeoutInMilliseconds > TIMEOUT_MAX) {
    throw new Error('setTimeout cannot be called with time greater than ' + TIMEOUT_MAX);
  }
  if (timeoutInMilliseconds < TIMEOUT_MIN) {
    throw new Error('setTimeout cannot be called with time lower than ' + TIMEOUT_MIN);
  }
  return timeoutInMilliseconds;
}
@link https://mrcoles.com/maximum-delay-settimeout/