-
-
Notifications
You must be signed in to change notification settings - Fork 87
test: verify reviewbot unified review (throwaway) #630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,19 @@ | ||||||
| // Small numeric helpers. | ||||||
|
|
||||||
| /** Clamp a percentage into the 0–100 range. */ | ||||||
| export function clampPercent(value: number): number { | ||||||
| if (value > 100) { | ||||||
| return 100; | ||||||
| } | ||||||
| return value; | ||||||
| } | ||||||
|
|
||||||
| /** Return the average of the numbers. */ | ||||||
| export function average(values: number[]): number { | ||||||
| return values.reduce((a, b) => a + b, 0) / values.length; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
🤖 Prompt for AI agents |
||||||
| } | ||||||
|
|
||||||
| /** Parse a port number from a string, defaulting to 8080. */ | ||||||
| export function parsePort(raw: string): number { | ||||||
| return parseInt(raw) || 8080; | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick · Port validation
Suggested change
🤖 Prompt for AI agents |
||||||
| } | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clampPercentonly caps values above 100 but does not prevent negative percentages from being returned.🤖 Prompt for AI agents