mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-15 13:58:20 +00:00
* feat(feedback): adopt 10-point recommendation scale * docs(feedback): keep OSS scale contract self-contained
9 lines
318 B
TypeScript
9 lines
318 B
TypeScript
export const FEEDBACK_RATING_SCALE = 10;
|
|
|
|
export function parseFeedbackRating(raw: string): number | null {
|
|
const trimmed = raw.trim();
|
|
if (!/^\d+$/.test(trimmed)) return null;
|
|
const rating = Number(trimmed);
|
|
return Number.isInteger(rating) && rating >= 0 && rating <= FEEDBACK_RATING_SCALE ? rating : null;
|
|
}
|