Comparing version 7.0.0 to 8.0.0
14
index.js
@@ -1,7 +0,5 @@ | ||
"use strict"; | ||
import {getServers} from "dns"; | ||
import {getServers} from "node:dns"; | ||
import {promisify} from "node:util"; | ||
import dnsSocket from "dns-socket"; | ||
import tlds from "tlds"; | ||
import {promisify} from "util"; | ||
@@ -93,3 +91,3 @@ const defaults = { | ||
export default async function caa(name, opts = {}) { | ||
export async function caa(name, opts = {}) { | ||
if (typeof name !== "string") throw new Error(`Expected a string for 'name', got ${name}`); | ||
@@ -103,3 +101,3 @@ name = normalizeName(name); | ||
opts = Object.assign({}, defaults, opts); | ||
opts = {...defaults, ...opts}; | ||
@@ -123,3 +121,3 @@ const socket = opts.dnsSocket || dnsSocket(); | ||
caa.matches = async (name, ca, opts = {}) => { | ||
export async function caaMatches(name, ca, opts = {}) { | ||
if (typeof name !== "string") throw new Error(`Expected a string for 'name', got ${name}`); | ||
@@ -145,2 +143,2 @@ if (typeof ca !== "string") throw new Error(`Expected a string for 'ca', got ${ca}`); | ||
return !names.length || names.includes(ca); | ||
}; | ||
} |
{ | ||
"name": "caa", | ||
"version": "7.0.0", | ||
"version": "8.0.0", | ||
"description": "rfc6844-conform CAA record lookup and validation", | ||
@@ -10,7 +10,4 @@ "author": "silverwind <me@silverwind.io>", | ||
"exports": "./index.js", | ||
"scripts": { | ||
"test": "make test" | ||
}, | ||
"engines": { | ||
"node": ">=12" | ||
"node": ">=14" | ||
}, | ||
@@ -27,18 +24,12 @@ "files": [ | ||
"dependencies": { | ||
"dns-socket": "^4.2.1", | ||
"tlds": "^1.220.0" | ||
"dns-socket": "^4.2.2", | ||
"tlds": "^1.236.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.13.16", | ||
"eslint": "7.24.0", | ||
"eslint-config-silverwind": "32.3.3", | ||
"jest": "27.0.0-next.8", | ||
"updates": "12.0.2", | ||
"versions": "8.4.7" | ||
}, | ||
"jest": { | ||
"verbose": false, | ||
"testTimeout": 10000, | ||
"transform": {} | ||
"eslint": "8.34.0", | ||
"eslint-config-silverwind": "65.1.0", | ||
"updates": "13.2.8", | ||
"versions": "10.4.1", | ||
"vitest": "0.28.4" | ||
} | ||
} |
@@ -12,8 +12,8 @@ # caa | ||
```js | ||
import caa from 'caa'; | ||
import {caa, caaMatches} from "caa"; | ||
await caa('subdomain.example.com'); | ||
await caa("subdomain.example.com"); | ||
// => [{flags: 0, tag: 'issue', value: 'letsencrypt.org', issuerCritical: false}] | ||
await caa.matches('subdomain.example.com', 'letsencrypt.org'); | ||
await caa.matches("subdomain.example.com", "letsencrypt.org"); | ||
// => true | ||
@@ -28,3 +28,3 @@ | ||
### `caa.matches(name, ca, [options])` | ||
### `caaMatches(name, ca, [options])` | ||
@@ -31,0 +31,0 @@ Test if the CAA record for `name` matches for certificate authority `ca`. |
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
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
5
1
8194
116
Updateddns-socket@^4.2.2
Updatedtlds@^1.236.0