This PR is a bit of a big one, and it's totally fine if you don't think this should be merged, either as-is or ever, but it's here for discussion at the very least and I'm happy to make changes 😄
The obvious big thing is that this PR wholesale ports the project into TypeScript (some types are still left as any as they were hard to figure out, but those can be worked on later).
Along the way, I decided to convert the internal 2-or-6-or-7 -item array type that was used for the matcher objects into actual Handler objects, along with some other refactoring.
Similarly, the dynamic-method-creation magic for onGet etc. was refactored into a nice helper class.
Some minor possible corner-case bugs uncovered by the addition of proper types got fixed (eg this fixes #151).
No tests were changed (aside from one that was looking into the handlers' internals) and everything still passes fine, yay :)
Code coverage is 97.28% over both tests and source (though some of the istanbul/nyc support looks a little shady).
⚠️ This PR does drop support for old Node and web runtimes; it expects Array.prototype.find() to be a thing, for instance. Also, support for old Axios versions is dropped.
⚠️ I have no idea the packaging still works as expected; I've never shipped a TypeScript package.
This PR is a bit of a big one, and it's totally fine if you don't think this should be merged, either as-is or ever, but it's here for discussion at the very least and I'm happy to make changes 😄
any
as they were hard to figure out, but those can be worked on later).Handler
objects, along with some other refactoring.onGet
etc. was refactored into a nice helper class.Code coverage is 97.28% over both tests and source (though some of the istanbul/nyc support looks a little shady).
Array.prototype.find()
to be a thing, for instance. Also, support for old Axios versions is dropped.