packages/ratelimit/lib/index.js
function setHeaders (headers, ratelimit, XHeaders = false) {
  if (XHeaders) {
    headers['X-Rate-Limit-Limit'] = ratelimit.limit
    headers['X-Rate-Limit-Remaining'] = ratelimit.remaining > 0 ? ratelimit.remaining : 0
    headers['X-Rate-Limit-Reset'] = ratelimit.reset
  }

  // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
  headers['Retry-After'] = Math.ceil(ratelimit.reset / 1000)
}
function setHeaders (headers, ratelimit, XHeaders = false) {
  if (XHeaders) {
    headers['X-Rate-Limit-Limit'] = ratelimit.limit
    headers['X-Rate-Limit-Remaining'] = ratelimit.remaining > 0 ? ratelimit.remaining : 0
    headers['X-Rate-Limit-Reset'] = ratelimit.reset
  }

  // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
  headers['Retry-After'] = Math.ceil(ratelimit.reset / 1000)
}
function setHeaders ( headers , ratelimit , XHeaders = false ) { if ( XHeaders ) { headers [ 'X-Rate-Limit-Limit' ] = ratelimit . limit headers [ 'X-Rate-Limit-Remaining' ] = ratelimit . remaining > 0 ? ratelimit . remaining : 0 headers [ 'X-Rate-Limit-Reset' ] = ratelimit . reset } // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After headers [ 'Retry-After' ] = Math . ceil ( ratelimit . reset / 1000 ) }
Set rate-limit headers
Set rate - limit headers