diff --git a/src/data/requests.json.ts b/src/data/requests.json.ts index 2b605b0..30874d3 100644 --- a/src/data/requests.json.ts +++ b/src/data/requests.json.ts @@ -12,8 +12,8 @@ const Requests = Schema.Array( Schema.Struct({ timestamp: Temporal.InstantFromStringSchema, preprint: Doi.DoiSchema, - server: Schema.optional(PreprintServer.PreprintServerSchema, { nullable: true }), - language: Schema.optional(LanguageCode.LanguageCodeSchema, { nullable: true }), + server: Schema.OptionFromNullishOr(PreprintServer.PreprintServerSchema, undefined), + language: Schema.OptionFromNullishOr(LanguageCode.LanguageCodeSchema, undefined), fields: Schema.Array(FieldIdSchema), subfields: Schema.Array(SubfieldIdSchema), domains: Schema.Array(DomainIdSchema), diff --git a/src/data/reviews.json.ts b/src/data/reviews.json.ts index 3cf5be2..409db74 100644 --- a/src/data/reviews.json.ts +++ b/src/data/reviews.json.ts @@ -11,7 +11,7 @@ const Reviews = Schema.Array( Schema.Struct({ createdAt: Temporal.PlainDateFromStringSchema, preprint: Doi.ParseDoiSchema, - language: Schema.optional(LanguageCode.LanguageCodeSchema), + language: Schema.OptionFromUndefinedOr(LanguageCode.LanguageCodeSchema), server: PreprintServer.PreprintServerSchema, }), ) diff --git a/src/data/users.json.ts b/src/data/users.json.ts index bb2412f..74209a2 100644 --- a/src/data/users.json.ts +++ b/src/data/users.json.ts @@ -6,8 +6,8 @@ import * as Temporal from '../lib/Temporal.js' const Users = Schema.Array( Schema.Struct({ - careerStage: Schema.optional(Schema.Literal('early', 'mid', 'late')), - location: Schema.optional(Schema.String), + careerStage: Schema.OptionFromUndefinedOr(Schema.Literal('early', 'mid', 'late')), + location: Schema.OptionFromUndefinedOr(Schema.String), timestamp: Temporal.InstantFromStringSchema, }), )