-
Notifications
You must be signed in to change notification settings - Fork 159
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
Typescript rewrite #360
Merged
Merged
Typescript rewrite #360
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ith the separate builds
… of coverage on CronParser, not sure why yet. Added a lot of FIXME's for things that don't make sense or aren't needed. Phase 2 basically done. Phase 3 will be a code review.
…to avoid any internal circular dependencies
…ronFileParser class
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This MR is a long-awaited modernization of this library, converting the existing codebase to TypeScript. Kudos to @MichaelLeeHobbs (most of the changes come from his MR), who started this initiative - without whom this wouldn't have been possible.
There have been some changes to the public API, resulting in a few breaking changes that need to be considered when switching to this version. Additionally, some bugs and minor performance regressions were fixed during the refactor.
Changelog
interval.fields
(CronExpression.interval
) now returns a readonly instance ofCronFieldsCollection
instead of a regular array. SeeCronFieldsCollection.from
for how to modify the underlying data structure.CronParser
to a standaloneCronFileParser
class (fixes Why not splitting the parser from the expression? #112).tap
tojest
.typedoc
(fixes Stringify argument not documented. #309, suggestion for iterator example #322, documentation: Document "fields" (Getter) in README #269).CronExpression.includesDate
to evaluate whether a given date matches the pattern (closes Feature Request: interval.includes #299).Performance improvements
While this release won't address the performance issues reported in #287, it will bring some performance improvements of around 20-30% on average, depending on the pattern complexity. The following benchmark results were produced on my 2023 MBP.
Benchmarks can be run locally by executing the command.:
Individual patterns can be benchmarked by executing
bench:pattern
command: