Skip to content

Commit

Permalink
Upgrade cacheable-lookup to 5.0.3
Browse files Browse the repository at this point in the history
Fixes #1220
  • Loading branch information
szmarczak committed May 11, 2020
1 parent 3f125f1 commit 9770e54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -47,7 +47,7 @@
"@szmarczak/http-timer": "^4.0.5",
"@types/cacheable-request": "^6.0.1",
"@types/responselike": "^1.0.0",
"cacheable-lookup": "^4.3.0",
"cacheable-lookup": "^5.0.3",
"cacheable-request": "^7.0.1",
"decompress-response": "^5.0.0",
"get-stream": "^5.1.0",
Expand Down
2 changes: 1 addition & 1 deletion source/core/index.ts
Expand Up @@ -788,7 +788,7 @@ export default class Request extends Duplex implements RequestEvents<Request> {
// `options.dnsCache`
if (options.dnsCache === true) {
options.dnsCache = new CacheableLookup();
} else if (!is.undefined(options.dnsCache) && !(options.dnsCache instanceof CacheableLookup)) {
} else if (!is.undefined(options.dnsCache) && !options.dnsCache.lookup) {

This comment has been minimized.

Copy link
@myfreeer

myfreeer May 12, 2020

Null-check seems needed for options.dnsCache here.

This comment has been minimized.

Copy link
@szmarczak

szmarczak May 12, 2020

Author Collaborator

Will do, thanks.

This comment has been minimized.

Copy link
@szmarczak

szmarczak May 12, 2020

Author Collaborator

Actually it's not needed since there assertions above. It will throw if dnsCache is null.

throw new TypeError(`Parameter \`dnsCache\` must be a CacheableLookup instance or a boolean, got ${is(options.dnsCache)}`);
}

Expand Down

0 comments on commit 9770e54

Please sign in to comment.