Comparing version 3.0.0 to 3.0.1
11
index.js
@@ -16,2 +16,5 @@ const debug = require('debug')('dat') | ||
// helper to support node6 | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } | ||
// helper to call promise-generating function | ||
@@ -41,3 +44,3 @@ function maybe (cb, p) { | ||
var noWellknownDat = opts && opts.noWellknownDat | ||
return maybe(cb, async function () { | ||
return maybe(cb, _asyncToGenerator(function* () { | ||
// parse the name as needed | ||
@@ -75,3 +78,3 @@ var nameParsed = url.parse(name) | ||
// do a DNS-over-HTTPS lookup | ||
res = await fetchDnsOverHttpsRecord(name, {host: dnsHost, path: dnsPath}) | ||
res = yield fetchDnsOverHttpsRecord(name, {host: dnsHost, path: dnsPath}) | ||
@@ -89,3 +92,3 @@ // parse the record | ||
// do a .well-known/dat lookup | ||
res = await fetchWellKnownRecord(name) | ||
res = yield fetchWellKnownRecord(name) | ||
if (res.statusCode === 0 || res.statusCode === 404) { | ||
@@ -117,3 +120,3 @@ debug('.well-known/dat lookup failed for name:', name, res.statusCode, res.err) | ||
} | ||
}) | ||
})) | ||
} | ||
@@ -120,0 +123,0 @@ |
{ | ||
"name": "dat-dns", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"description": "Issue DNS lookups for Dat archives using HTTPS requests to the target host.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -58,3 +58,3 @@ # dat-dns | ||
**Option 1. (DNS-over-HTTPS)** Create a DNS TXT record witht he following schema: | ||
**Option 1 (DNS-over-HTTPS).** Create a DNS TXT record witht he following schema: | ||
@@ -65,3 +65,3 @@ ``` | ||
**Option 2. (.wellknown/dat)** Place a file at `/.well-known/dat` with the following schema: | ||
**Option 2 (.well-known/dat).** Place a file at `/.well-known/dat` with the following schema: | ||
@@ -68,0 +68,0 @@ ``` |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
18128
487
2