Skip to content

Commit 4258142

Browse files
committed
feat(RequestHandler): noCacheCheck
1 parent 1462d3a commit 4258142

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Private/RequestHandler.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ class RequestHandler {
2727
}
2828

2929
async request(endpoint: string, options?: RequestOptions): Promise<RequestData> {
30-
options = { raw: options?.raw ?? false, noCache: options?.noCache ?? false };
31-
if (this.client.cacheHandler.has(endpoint)) {
30+
options = {
31+
raw: options?.raw ?? false,
32+
noCache: options?.noCache ?? false,
33+
noCacheCheck: options?.noCacheCheck ?? false
34+
};
35+
if (options.noCacheCheck && this.client.cacheHandler.has(endpoint)) {
3236
const data = this.client.cacheHandler.get(endpoint);
3337
return new RequestData(data.data, data.headers, {
3438
status: 200,

src/Types/Requests.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
export interface RequestOptions {
44
raw?: boolean;
55
noCache?: boolean;
6+
noCacheCheck?: boolean;
67
}

0 commit comments

Comments
 (0)