Socket
Socket
Sign inDemoInstall

cacheable-lookup

Package Overview
Dependencies
0
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.3 to 5.0.4

4

package.json
{
"name": "cacheable-lookup",
"version": "5.0.3",
"version": "5.0.4",
"description": "A cacheable dns.lookup(…) that respects the TTL",
"engines": {
"node": ">=10"
"node": ">=10.6.0"
},

@@ -8,0 +8,0 @@ "files": [

@@ -209,3 +209,7 @@ 'use strict';

cached = await newPromise;
try {
cached = await newPromise;
} finally {
delete this._pending[hostname];
}
}

@@ -324,25 +328,17 @@ }

try {
let query = await this._resolve(hostname);
let query = await this._resolve(hostname);
if (query.entries.length === 0 && this._fallback) {
query = await this._lookup(hostname);
if (query.entries.length === 0 && this._fallback) {
query = await this._lookup(hostname);
if (query.entries.length !== 0) {
// Use `dns.lookup(...)` for that particular hostname
this._hostnamesToFallback.add(hostname);
}
if (query.entries.length !== 0) {
// Use `dns.lookup(...)` for that particular hostname
this._hostnamesToFallback.add(hostname);
}
}
const cacheTtl = query.entries.length === 0 ? this.errorTtl : query.cacheTtl;
await this._set(hostname, query.entries, cacheTtl);
const cacheTtl = query.entries.length === 0 ? this.errorTtl : query.cacheTtl;
await this._set(hostname, query.entries, cacheTtl);
delete this._pending[hostname];
return query.entries;
} catch (error) {
delete this._pending[hostname];
throw error;
}
return query.entries;
}

@@ -349,0 +345,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc