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.
Convert code and tests to Typescript.
There are still several issues:
cron-parser
are incorrect, and not everything is exported. I submitted Fix types so that all types are exported harrisiirak/cron-parser#210 to fix the types, but I realized that PR is wrong as well and needs to be corrected. In the meantime I bundled the accurate type declarations forcron-parser
ascron-parser.d.ts
.prepareNextInvocation()
inInvocation.ts
usesCronExpression._endDate
which is an undocumented and unexported property. I included it in the bundled type declarations forcron-parser
, but I don't think this is an optimal solution.convenience-method-tests.ts
usesinvocations
andjob.pendingInvocations
. These should really be private and unexported, and should be tested differently.test
to use ts-node to run tape. I don't have any experience with airtap, so I didn't convert thetest:browser
script. In addition, I couldn't figure out how to convert the nyc scripts.Job
supports passing a generator function that returns a iterator that returns the job function (see Add support for generators #210). I think this use case is extremely uncommon nowadays. It looks like the original PR was designed to be able to support asynchronous functions that used generators, whereas now everyone would use async functions or Promises. I think support for generators should be dropped and replaced with support for Promises / async functions.Closes #507.