mirror of
https://github.com/actions/stale.git
synced 2025-12-13 13:42:17 +00:00
Add RateLimit
This commit is contained in:
15
src/classes/rate-limit.ts
Normal file
15
src/classes/rate-limit.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import {IRateLimit, OctokitRateLimit} from '../interfaces/rate-limit';
|
||||
|
||||
export class RateLimit implements IRateLimit {
|
||||
readonly limit: number;
|
||||
readonly remaining: number;
|
||||
readonly reset: Date;
|
||||
readonly used: number;
|
||||
|
||||
constructor(rateLimit: Readonly<OctokitRateLimit>) {
|
||||
this.limit = rateLimit.limit;
|
||||
this.remaining = rateLimit.remaining;
|
||||
this.used = rateLimit.used;
|
||||
this.reset = new Date(rateLimit.reset * 1000);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user