Open TjlHope opened 4 years ago
It's defined as
enum Status { RECEIVED = "RECEIVED", QUEUED = "QUEUED", RUNNING = "RUNNING", EXECUTING = "EXECUTING", DONE = "DONE" }
But as there's no real matching typescript style enum in the generated js code, which means something like the following doesn't work:
if (limiter.jobStatus("id") === Bottleneck.Status.DONE)
The definition should use const enum so typescript converts it at compile time, rather than attempting to use a non-existent runtime js object.
const enum
I'm happy to open a trivial PR, but wasn't sure if you'd want a test case or similar. Thanks, Tom
It's defined as
But as there's no real matching typescript style enum in the generated js code, which means something like the following doesn't work:
The definition should use
const enum
so typescript converts it at compile time, rather than attempting to use a non-existent runtime js object.I'm happy to open a trivial PR, but wasn't sure if you'd want a test case or similar. Thanks, Tom