Refactor job filtering logic and improve expiry calculation#66
Refactor job filtering logic and improve expiry calculation#66priyanshuuu777 wants to merge 2 commits intonumfocus:mainfrom
Conversation
|
Thanks for your suggested contribution, @priyanshuuu777. Please:
|
|
This PR was created using: Node.js (for local testing) Modern JavaScript (ES6+) VS Code (development environment) Git for version control Readability – Switched to Array.filter() for a more declarative approach. Maintainability – Simplified expiration logic using a constant instead of day calculations. Safety – Added default parameters and safer numeric parsing to prevent runtime errors. Robustness – Improved remote matching logic to handle case-insensitive values. Refactored loop-based filtering to use Array.filter() for improved readability. |
|
No, I meant which agent. Please split into one commit per change, with a detailed message motivating that commit. |
|
This PR was produced manually by me. refactor: replace imperative loop with Array.filter for clearer logic Replaced the manual for-loop and include flag pattern with This reduces mutable state, removes nested condition checks, No behaviour changes intended. 2 Replaced day-difference computation with a direct millisecond This improves clarity and avoids unnecessary Math.ceil and 3 Improved parsing of ossTimeGt by validating numeric input before Behaviour remains unchanged for valid numeric inputs. 4 Replaced string includes check with case-insensitive regex Improves robustness without changing intended behavior. 5 Added default values to prevent runtime errors when This makes the function more defensive and safer to reuse |
- Refresh styling with cleaner, modern design - Add smooth hover effects and improved shadows - Switch to CSS Grid for responsive layout - Improve filter sidebar with rounded corners - Add mobile responsiveness - Update dependencies (dompurify, gatsby)
Summary
Refactored the
filterJobsfunction for better readability and reliability.Improvements
Array.filter()No breaking changes.