Skip to content

Commit

Permalink
Make it easier to work with by using Option types
Browse files Browse the repository at this point in the history
Refs #31
  • Loading branch information
thewilkybarkid committed Jul 9, 2024
1 parent 1b4eb5f commit 952ee24
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/data/requests.json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion src/data/reviews.json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
)
Expand Down
4 changes: 2 additions & 2 deletions src/data/users.json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}),
)
Expand Down

0 comments on commit 952ee24

Please sign in to comment.