First Commit. Duplicate bunext-sqlite preset

This commit is contained in:
2026-10-18 16:47:11 +01:00
commit 81e4a8aecc
718 changed files with 41695 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
import { AppData } from "@/src/data/app-data";
type Params = {
password?: string;
};
/**
* Returns a user-facing error message, or `undefined` when the
* password is acceptable.
*/
export default function validatePassword({ password }: Params) {
if (!password) {
return `Please enter a password`;
}
if (password.length < AppData["PasswordMinLength"]) {
return `Passwords must be at least ${AppData["PasswordMinLength"]} characters`;
}
if (password.length > AppData["PasswordMaxLength"]) {
return `Passwords can't be longer than ${AppData["PasswordMaxLength"]} characters`;
}
if (!password.trim()) {
return `Passwords can't be only spaces`;
}
return undefined;
}