MCPcopy Create free account
hub / github.com/github/gh-aw / parseResetTimestamp

Function parseResetTimestamp

actions/setup/js/github_rate_limit_logger.cjs:71–76  ·  view source on GitHub ↗

* Parse an x-ratelimit-reset Unix timestamp (seconds) into an ISO 8601 string. * Returns null when the header is absent or unparseable. * * @param {string | undefined} resetHeader * @returns {string | null}

(resetHeader)

Source from the content-addressed store, hash-verified

69 * @returns {string | null}
70 */
71function parseResetTimestamp(resetHeader) {
72 if (!resetHeader) return null;
73 const seconds = parseInt(resetHeader, 10);
74 if (isNaN(seconds)) return null;
75 return new Date(seconds * 1000).toISOString();
76}
77
78// ---------------------------------------------------------------------------
79// Public API

Callers 2

logRateLimitFromResponseFunction · 0.85
logRetryEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected