PDPA Features: ✅ Cookie consent banner ✅ Consent logging API ✅ Admin dashboard ✅ Privacy Policy ✅ Terms & Conditions Technical: ✅ Astro 5.x + Tailwind v4 ✅ Docker on port 80 ✅ SQLite database ✅ 15 pages built Ready for Easypanel deployment.
29 lines
837 B
JavaScript
29 lines
837 B
JavaScript
export function defineDriver(factory) {
|
|
return factory;
|
|
}
|
|
export function normalizeKey(key, sep = ":") {
|
|
if (!key) {
|
|
return "";
|
|
}
|
|
return key.replace(/[:/\\]/g, sep).replace(/^[:/\\]|[:/\\]$/g, "");
|
|
}
|
|
export function joinKeys(...keys) {
|
|
return keys.map((key) => normalizeKey(key)).filter(Boolean).join(":");
|
|
}
|
|
export function createError(driver, message, opts) {
|
|
const err = new Error(`[unstorage] [${driver}] ${message}`, opts);
|
|
if (Error.captureStackTrace) {
|
|
Error.captureStackTrace(err, createError);
|
|
}
|
|
return err;
|
|
}
|
|
export function createRequiredError(driver, name) {
|
|
if (Array.isArray(name)) {
|
|
return createError(
|
|
driver,
|
|
`Missing some of the required options ${name.map((n) => "`" + n + "`").join(", ")}`
|
|
);
|
|
}
|
|
return createError(driver, `Missing required option \`${name}\`.`);
|
|
}
|