Skip to content

Commit 9dbffcf

Browse files
committed
feat: allow users to pass cache: true
1 parent 4a785c2 commit 9dbffcf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ class Resolver extends dns.promises.Resolver {
286286
// if `cache: false` then caching is disabled
287287
// but note that this doesn't disable `got` dnsCache which is separate
288288
// so to turn that off, you need to supply `dnsCache: undefined` in `got` object (?)
289+
if (this.options.cache === true) this.options.cache = new Map();
290+
289291
if (this.options.cache instanceof Map) {
290292
// each of the types have their own Keyv with prefix
291293
for (const type of this.constructor.TYPES) {

0 commit comments

Comments
 (0)