Skip to content

Commit

Permalink
Enable requests for SocArXiv preprint reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
thewilkybarkid committed May 2, 2024
1 parent 8e56d73 commit 13c2081
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion src/review-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import type {
PreprintId,
PsyarxivPreprintId,
ScieloPreprintId,
SocarxivPreprintId,
} from './types/preprint-id'

export type ReviewRequest = IncompleteReviewRequest | CompletedReviewRequest
Expand All @@ -28,6 +29,7 @@ export type ReviewRequestPreprintId =
| OsfPreprintsPreprintId
| PsyarxivPreprintId
| ScieloPreprintId
| SocarxivPreprintId

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

export function isReviewRequestPreprintId(preprint: PreprintId): preprint is ReviewRequestPreprintId {
return match(preprint.type)
.with('arxiv', 'biorxiv', 'ecoevorxiv', 'edarxiv', 'medrxiv', 'osf-preprints', 'psyarxiv', 'scielo', () => true)
.with(
'arxiv',
'biorxiv',
'ecoevorxiv',
'edarxiv',
'medrxiv',
'osf-preprints',
'psyarxiv',
'scielo',
'socarxiv',
() => true,
)
.otherwise(() => false)
}
2 changes: 1 addition & 1 deletion test/fc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,7 @@ export const reviewRequestPreprintId = (): fc.Arbitrary<ReviewRequestPreprintId>
osfPreprintsPreprintId(),
psyarxivPreprintId(),
scieloPreprintId(),
socarxivPreprintId(),
)

export const notAReviewRequestPreprintId = (): fc.Arbitrary<Exclude<PreprintId, ReviewRequestPreprintId>> =>
Expand All @@ -838,7 +839,6 @@ export const notAReviewRequestPreprintId = (): fc.Arbitrary<Exclude<PreprintId,
psychArchivesPreprintId(),
researchSquarePreprintId(),
scienceOpenPreprintId(),
socarxivPreprintId(),
techrxivPreprintId(),
zenodoPreprintId(),
)
Expand Down

0 comments on commit 13c2081

Please sign in to comment.