kaneo (minimalist kanban) fork to experiment adding a tangled integration
github.com/usekaneo/kaneo
1import * as v from "valibot";
2
3export const tangledConfigSchema = v.object({
4 repoAtUri: v.string(),
5});
6
7export type TangledConfig = v.InferOutput<typeof tangledConfigSchema>;
8
9export async function validateTanlgedConfig(
10 config: unknown,
11): Promise<{ valid: boolean; errors?: string[] }> {
12 try {
13 v.parse(tangledConfigSchema, config);
14 return { valid: true };
15 } catch (error) {
16 if (error instanceof v.ValiError) {
17 return {
18 valid: false,
19 errors: error.issues.map((issue) => issue.message),
20 };
21 }
22 return {
23 valid: false,
24 errors: [error instanceof Error ? error.message : "Invalid config"],
25 };
26 }
27}