os-dns-native
Advanced tools
Comparing version 1.0.4 to 1.1.0
import type * as dns from 'dns'; | ||
declare let osDns: typeof dns & { withNodeFallback: typeof dns }; | ||
declare let osDns: typeof dns & { | ||
withNodeFallback: typeof dns, | ||
wasNativelyLookedUp: (result: unknown) => boolean; | ||
}; | ||
export = osDns; |
10
index.js
@@ -53,2 +53,4 @@ 'use strict'; | ||
const kWasNativelyLookedUp = Symbol('os-dns-native.kWasNativelyLookedUp'); | ||
function withFallback(fn, nodeFn) { | ||
@@ -61,2 +63,3 @@ return function(...args) { | ||
} else { | ||
result[kWasNativelyLookedUp] = true; | ||
cb(null, result); | ||
@@ -68,2 +71,6 @@ } | ||
function wasNativelyLookedUp(result) { | ||
return !!(result && typeof result === 'object' && result[kWasNativelyLookedUp]); | ||
} | ||
const withNodeFallback = { | ||
@@ -94,3 +101,4 @@ resolve: withFallback(resolve, nodeDns.resolve), | ||
promises, | ||
withNodeFallback | ||
withNodeFallback, | ||
wasNativelyLookedUp | ||
}; |
{ | ||
"name": "os-dns-native", | ||
"version": "1.0.4", | ||
"version": "1.1.0", | ||
"description": "Perform DNS queries using OS APIs", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
20893
109