-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
fix: add IMethods interface for use in time module functions #2111
Conversation
58b4892
to
2038608
Compare
2038608
to
a7bcc4c
Compare
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.
I would love feedback on this approach to removing any and defining an interface for strictly typing, is this the recommended approach for this project?
Yep, this approach is good, and all in keeping with project style. Thanks!
@@ -10,8 +10,6 @@ Please see [CONTRIBUTING.md](https://github.com/cucumber/cucumber/blob/master/CO | |||
## [Unreleased] | |||
### Added | |||
- `IMethods` interface for use in `getTimestamp`, `durationBetweenTimestamps`, and `wrapPromiseWithTimeout` functions and `methods` in `time` module instead of explicit `any` ([#2111](https://github.com/cucumber/cucumber-js/pull/2111)) | |||
|
|||
### Added |
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.
🙇♂️ Thank you!
I'll be vigilant of this in the future.
🤔 What's changed?
This PR does the following,
IMethods
intime.ts
extending fromGlobalTimers
beginTiming
andendTiming
insrc/time.ts
void
forbeginTiming
number
forendTiming
methods
object to make use ofIMethods
interfacetimeoutId
to useTimerId
instead ofNodeJS.Timeout
⚡️ What's your motivation?
The motivation for this update/change is the incremental completion of #1648 in small manageable PRs.
I imagine this will be one of multiple PRs to replace explicit
any
with a type.🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
any
and defining an interface forstrictly typing
, is this the recommended approach for this project?📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.