-
Notifications
You must be signed in to change notification settings - Fork 12
Adjusted some logic for the Timespan logic #214
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
Adjusted some logic for the Timespan logic #214
Conversation
|
Thank you! |
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.
Pull request overview
This PR aims to enable parsing of complex timespan queries with spaces like "5d 1h 50m 666s" for commands like timeout and tempban. The changes fix the incorrect use of named capture groups in the regex match results and add a development Docker Compose configuration.
Key Changes:
- Fixed regex capture group access in
parseTimespanfunction (changed fromelement.groups?.[1/2]toelement[1/2]) - Removed unnecessary blank lines in
getDurationswitch statement - Added new
docker-compose.dev.ymlfor development environment
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/util/timespan.ts | Fixes capture group access from incorrect named groups to positional array indices, enabling the regex to actually parse timespan strings |
| docker-compose.dev.yml | Adds a PostgreSQL development environment configuration with health checks |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…res setup - Remove unnecessary blank lines in `timespan.ts` - Refactor regex group access and simplify duration calculation logic
- Update regex group access from `.groups` to direct array indexing - Simplify duration calculation by using direct element access instead of optional chaining
2e67c05 to
2e04e07
Compare
|
I just had some commit messages fuckery, and failed to update them correctly |
Implements #210 this enables writting complex queries like
5d 1h 50m 666s ( 5 days + 1 hour + 50 minutes + 666 seconds )
( This will affect tempBan too )