Comparing version 9.2.0 to 10.0.0
@@ -9,4 +9,10 @@ type CaaOpts = { | ||
}; | ||
export declare function caa(name: any, opts?: CaaOpts): Promise<any>; | ||
export declare function caaMatches(name: any, ca: any, opts?: {}): Promise<any>; | ||
type CaaRecord = { | ||
flags: number; | ||
tag: string; | ||
value: string; | ||
issuerCritical: boolean; | ||
}; | ||
export declare function caa(name: string, opts?: CaaOpts): Promise<CaaRecord[]>; | ||
export declare function caaMatches(name: string, ca: string, opts?: CaaOpts): Promise<boolean>; | ||
export {}; |
@@ -18,3 +18,5 @@ import { getServers } from "node:dns"; | ||
const parent = (name) => name.split(".").splice(1).join("."); | ||
const selectServer = (servers, retries, tries) => servers[(tries - retries) % servers.length]; | ||
function selectServer(servers, retries, tries) { | ||
return servers[(tries - retries) % servers.length]; | ||
} | ||
function normalizeName(name = "") { | ||
@@ -83,4 +85,2 @@ name = name.toLowerCase(); | ||
async function caa(name, opts = {}) { | ||
if (typeof name !== "string") | ||
throw new Error(`Expected a string for 'name', got ${name}`); | ||
name = normalizeName(name); | ||
@@ -109,6 +109,2 @@ if (!opts.servers) { | ||
async function caaMatches(name, ca, opts = {}) { | ||
if (typeof name !== "string") | ||
throw new Error(`Expected a string for 'name', got ${name}`); | ||
if (typeof ca !== "string") | ||
throw new Error(`Expected a string for 'ca', got ${ca}`); | ||
name = normalizeName(name); | ||
@@ -115,0 +111,0 @@ ca = normalizeName(ca); |
{ | ||
"name": "caa", | ||
"version": "9.2.0", | ||
"version": "10.0.0", | ||
"description": "rfc6844-conform CAA record lookup and validation", | ||
@@ -24,4 +24,2 @@ "author": "silverwind <me@silverwind.io>", | ||
"devDependencies": { | ||
"@babel/eslint-parser": "7.24.5", | ||
"@babel/plugin-syntax-import-assertions": "7.24.1", | ||
"@types/node": "20.12.12", | ||
@@ -28,0 +26,0 @@ "eslint": "8.57.0", |
@@ -14,5 +14,4 @@ # caa | ||
await caa.matches("example.com", "letsencrypt.org"); | ||
await caaMatches("example.com", "letsencrypt.org"); | ||
// => true | ||
``` | ||
@@ -19,0 +18,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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
11
139
1
8483
39