Skip to content

Commit

Permalink
Optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
MrVauxs committed Feb 11, 2024
1 parent c2dfedc commit ba7d507
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions zod/indexes/datatypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,13 @@ export const contentDatatype = z
])
.describe("A content datatype's name, as it appears in the JSON data itself.");

// TODO: merge the below once Zod works properly with records and optional properties
const sourceDatatype = z.enum(["source"]);
const metaDatatypeSansSource = z.enum(["license", "sourceGroup"]);

export const metaDatatype = metaDatatypeSansSource
.or(sourceDatatype)
export const metaDatatype = z.enum(["license", "source", "sourceGroup"])
.describe("A metafile datatype's name, as it appears in the JSON data itself.");

const metaDatatypeSansSource = metaDatatype.exclude(["source"]);

export const datatypeSansSource = contentDatatype.or(metaDatatypeSansSource);
// END TODO

export const datatype = contentDatatype
.or(metaDatatype)
Expand Down

0 comments on commit ba7d507

Please sign in to comment.