Skip to content
Snippets Groups Projects
Commit 70123251 authored by michael.minelli's avatar michael.minelli
Browse files

AssignmentFile => Migrate to zod format

parent ace21995
Branches
No related tags found
No related merge requests found
import ImmutableFileDescriptor from './ImmutableFileDescriptor';
import { ImmutableFileDescriptor, immutableFileDescriptorSchema } from './ImmutableFileDescriptor';
import { z } from 'zod';
interface AssignmentFile {
dojoAssignmentVersion: number,
version: number,
const AssignmentFile = z.object({
dojoAssignmentVersion: z.number(),
version : z.number(),
immutable : z.array(immutableFileDescriptorSchema.transform(value => value as ImmutableFileDescriptor)),
result : z.object({
container: z.string(),
volume : z.string().optional()
})
}).strict();
immutable: Array<ImmutableFileDescriptor>
result: {
container: string, volume?: string
}
}
type AssignmentFile = z.infer<typeof AssignmentFile>;
export default AssignmentFile;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment