mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-10-14 02:16:15 +00:00
remove @ + www json files, update reserved
This commit is contained in:
1 parent
3fd2839c98
commit
964fd4b060
6 files changed
+24
-123
No files matched your search
+14
-16
@@ -97,25 +97,23 @@ async function validateFileName(t, file) {
|
||||
t.false(file.includes("--"), `${file}: File name should not contain consecutive hyphens`);
|
||||
t.false(file.startsWith("_redirect."), `${file}: File name should not start with _redirect`);
|
||||
|
||||
if (file !== "@.json") {
|
||||
const subdomain = file.replace(/\.json$/, "");
|
||||
const subdomain = file.replace(/\.json$/, "");
|
||||
|
||||
t.regex(
|
||||
subdomain + ".is-a.dev",
|
||||
hostnameRegex,
|
||||
`${file}: FQDN must be 1-253 characters, can use letters, numbers, dots, and non-consecutive hyphens.`
|
||||
);
|
||||
t.false(reservedDomains.includes(subdomain), `${file}: Subdomain name is reserved`);
|
||||
t.true(
|
||||
!reservedDomains.some((reserved) => subdomain.endsWith(`.${reserved}`)),
|
||||
`${file}: Subdomain name is reserved`
|
||||
);
|
||||
t.regex(
|
||||
subdomain + ".is-a.dev",
|
||||
hostnameRegex,
|
||||
`${file}: FQDN must be 1-253 characters, can use letters, numbers, dots, and non-consecutive hyphens.`
|
||||
);
|
||||
t.false(reservedDomains.includes(subdomain), `${file}: Subdomain name is reserved`);
|
||||
t.true(
|
||||
!reservedDomains.some((reserved) => subdomain.endsWith(`.${reserved}`)),
|
||||
`${file}: Subdomain name is reserved`
|
||||
);
|
||||
|
||||
const rootSubdomain = subdomain.split(".").pop();
|
||||
const rootSubdomain = subdomain.split(".").pop();
|
||||
|
||||
if (!excludedDomains.includes(rootSubdomain)) {
|
||||
t.false(rootSubdomain.startsWith("_"), `${file}: Root subdomains should not start with an underscore`);
|
||||
}
|
||||
if (!excludedDomains.includes(rootSubdomain)) {
|
||||
t.false(rootSubdomain.startsWith("_"), `${file}: Root subdomains should not start with an underscore`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user