jimbosupernova
jimbosupernova
NNuxt
Created by Yassaaa on 7/8/2024 in #❓・help
Nuxt DevTools Modules page is bugged
Would love to know a fix for this
6 replies
NNuxt
Created by jimbosupernova on 7/23/2024 in #❓・help
Adding type safety with Valibot
FYI I fixed it by wrapping the schema object in a v.partial:
const scheduleSchema = v.partial(
v.object({
id: v.nullable(v.string()),
revision_id: v.optional(v.nullable(v.string())),
created: v.nullable(v.number()),
updated: v.nullable(v.number()),
name: v.nullable(v.string()),
lessons: v.nullable(
v.array(
v.object({
id: v.string(),
name: v.string(),
description: v.string(),
pages: v.array(v.object({})),
owner: v.string(),
track: v.string(),
audit: v.object({
available_at: v.nullable(v.number()),
completed_at: v.nullable(v.number()),
first_viewed_at: v.nullable(v.number()),
times_viewed: v.nullable(v.number()),
last_notified: v.nullable(v.number()),
}),
}),
),
),
owner: v.string(),
}),
);
const scheduleSchema = v.partial(
v.object({
id: v.nullable(v.string()),
revision_id: v.optional(v.nullable(v.string())),
created: v.nullable(v.number()),
updated: v.nullable(v.number()),
name: v.nullable(v.string()),
lessons: v.nullable(
v.array(
v.object({
id: v.string(),
name: v.string(),
description: v.string(),
pages: v.array(v.object({})),
owner: v.string(),
track: v.string(),
audit: v.object({
available_at: v.nullable(v.number()),
completed_at: v.nullable(v.number()),
first_viewed_at: v.nullable(v.number()),
times_viewed: v.nullable(v.number()),
last_notified: v.nullable(v.number()),
}),
}),
),
),
owner: v.string(),
}),
);
2 replies
NNuxt
Created by Yassaaa on 7/8/2024 in #❓・help
Nuxt DevTools Modules page is bugged
I have the exact same issue
6 replies