clan-app: Add more symlinks to ui-2d

This commit is contained in:
Qubasa
2025-06-18 20:34:54 +02:00
parent c53874c525
commit 4f60dbfe28
9 changed files with 8 additions and 216 deletions

View File

@@ -1,33 +0,0 @@
export function isValidHostname(value: string | null | undefined) {
if (typeof value !== "string") return false;
const validHostnameChars = /^[a-zA-Z0-9-.]{1,253}\.?$/g;
if (!validHostnameChars.test(value)) {
return false;
}
if (value.endsWith(".")) {
value = value.slice(0, value.length - 1);
}
if (value.length > 253) {
return false;
}
const labels = value.split(".");
const isValid = labels.every(function (label) {
const validLabelChars = /^([a-zA-Z0-9-]+)$/g;
const validLabel =
validLabelChars.test(label) &&
label.length < 64 &&
!label.startsWith("-") &&
!label.endsWith("-");
return validLabel;
});
return isValid;
}

1
pkgs/clan-app/ui-2d/util.ts Symbolic link
View File

@@ -0,0 +1 @@
../ui/util.ts