const formSchema = type({
name: type('string.trim').narrow((name, ctx) => {
if (!name.endsWith('.project')) return true;
return ctx.reject({
problem: `cannot end with .project (was "${name}")`
});
}),
id: type('string | undefined').pipe((v) => v ?? nanoid()),
parentId: type('string')
});
const formSchema = type({
name: type('string.trim').narrow((name, ctx) => {
if (!name.endsWith('.project')) return true;
return ctx.reject({
problem: `cannot end with .project (was "${name}")`
});
}),
id: type('string | undefined').pipe((v) => v ?? nanoid()),
parentId: type('string')
});