Skip to content

Commit

Permalink
Enable requests for arXiv preprint reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
thewilkybarkid committed Apr 30, 2024
1 parent daa5fe4 commit 37d20a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/review-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import * as C from 'io-ts/Codec'
import * as D from 'io-ts/Decoder'
import type { Orcid } from 'orcid-id-ts'
import { match } from 'ts-pattern'
import type { BiorxivPreprintId, PreprintId, ScieloPreprintId } from './types/preprint-id'
import type { ArxivPreprintId, BiorxivPreprintId, PreprintId, ScieloPreprintId } from './types/preprint-id'

export type ReviewRequest = IncompleteReviewRequest | CompletedReviewRequest

export type ReviewRequestPreprintId = BiorxivPreprintId | ScieloPreprintId
export type ReviewRequestPreprintId = ArxivPreprintId | BiorxivPreprintId | ScieloPreprintId

export interface IncompleteReviewRequest {
readonly status: 'incomplete'
Expand Down Expand Up @@ -87,6 +87,6 @@ export const saveReviewRequest = (

export function isReviewRequestPreprintId(preprint: PreprintId): preprint is ReviewRequestPreprintId {
return match(preprint.type)
.with('biorxiv', 'scielo', () => true)
.with('arxiv', 'biorxiv', 'scielo', () => true)
.otherwise(() => false)
}
3 changes: 1 addition & 2 deletions test/fc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -813,12 +813,11 @@ export const orcid = (): fc.Arbitrary<Orcid> =>
.filter(isOrcid)

export const reviewRequestPreprintId = (): fc.Arbitrary<ReviewRequestPreprintId> =>
fc.oneof(biorxivPreprintId(), scieloPreprintId())
fc.oneof(arxivPreprintId(), biorxivPreprintId(), scieloPreprintId())

export const notAReviewRequestPreprintId = (): fc.Arbitrary<Exclude<PreprintId, ReviewRequestPreprintId>> =>
fc.oneof(
africarxivPreprintId(),
arxivPreprintId(),
authoreaPreprintId(),
chemrxivPreprintId(),
eartharxivPreprintId(),
Expand Down

0 comments on commit 37d20a3

Please sign in to comment.