리펙토링: 코드 최적화
This commit is contained in:
@@ -3,11 +3,15 @@ import type { ProblemCount } from "@/store/gameStore";
|
||||
|
||||
interface PlayPageProps {
|
||||
searchParams?: {
|
||||
count?: string;
|
||||
count?: string | string[];
|
||||
};
|
||||
}
|
||||
|
||||
function parseProblemCount(count?: string): ProblemCount {
|
||||
function parseProblemCount(count?: string | string[]): ProblemCount {
|
||||
if (Array.isArray(count)) {
|
||||
return parseProblemCount(count[0]);
|
||||
}
|
||||
|
||||
return count === "5" ? 5 : 10;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user