-
Notifications
You must be signed in to change notification settings - Fork 5
Add array helper utilities #7
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
Conversation
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.
🤖 Claude Code Review
This PR adds three utility functions for array manipulation: chunk, unique, and shuffle. The code is well-structured and safe. One potential issue exists in the chunk function where passing size <= 0 could cause an infinite loop, but this is the only concern worth noting.
📁 Files reviewed (1 files, 24 changes)
- 🆕
src/lib/array-helpers.ts(+24/-0)
Issues Found
- 🚨 Critical: 1
❌ Changes requested - Please fix the critical issues before merging.
Powered by Claude AI
| * Array helper utilities | ||
| */ | ||
|
|
||
| export function chunk<T>(array: T[], size: number): T[][] { |
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.
🚨 CRITICAL
The chunk function will create an infinite loop if size is 0 or negative. Add a guard clause: if (size <= 0) throw new Error('Size must be positive') or return [array] to prevent this.
|
/review |
Issues have been resolved. Dismissing previous review.
🤖 Claude Code ReviewThis PR adds three utility functions for array manipulation: chunk, unique, and shuffle. The code is well-implemented with proper TypeScript generics and immutable patterns. All functions handle edge cases appropriately and use safe array operations. 📁 Files reviewed (1 files, 24 changes)
✅ Approved - No issues found. Powered by Claude AI Note: Unable to post inline comments |
|
Closing test PR |
Test PR to verify /review command. Comment /review to trigger Claude review manually.