Use TERMS.some
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Jared He 2021-11-22 16:10:17 -06:00
parent 73cf9530be
commit 92a115fc35
1 changed files with 1 additions and 1 deletions

View File

@ -3,7 +3,7 @@ export type Term = typeof TERMS[number];
// https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates
export function isTerm(x: string): x is Term {
return x === "winter" || x === "spring" || x === "fall";
return TERMS.some((term) => x === term);
}
export function capitalize(str: string) {