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.
22 lines
623 B
JavaScript
22 lines
623 B
JavaScript
import { parseDef } from "../parseDef.js";
|
|
import { parseAnyDef } from "./any.js";
|
|
export const parseOptionalDef = (def, refs) => {
|
|
if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
|
|
return parseDef(def.innerType._def, refs);
|
|
}
|
|
const innerSchema = parseDef(def.innerType._def, {
|
|
...refs,
|
|
currentPath: [...refs.currentPath, "anyOf", "1"],
|
|
});
|
|
return innerSchema
|
|
? {
|
|
anyOf: [
|
|
{
|
|
not: parseAnyDef(refs),
|
|
},
|
|
innerSchema,
|
|
],
|
|
}
|
|
: parseAnyDef(refs);
|
|
};
|