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.
Hi,
I reworked your module a little - I hope I'm not stepping on any toes here. :)
Here's what I did and why:
I did this to make the module work like a standard node modules rather than like
a client side javascript library. The previous implementation was a little
awkward.
There was a LOT of validation that was incredibly specific where it really didn't
need to be. I replaced a lot of this validation with
assert
s to simplify thecode around these things.
Requests were incorrectly leaving
Content-Type
blank which caused errors to bereturned as HTML rather than JSON. I added the header so that errors are parsed
and returned to the user directly rather than making assumptions about the
errors.
I added some tap tests to the library prior to reworking the module and found
that certain bits of functionality weren't actually working. Within the reply,
dialogs were not working as intended and would throw errors. I've omitted those
pieces until I can figure out a solution. I also added a lint step to the test
that follows the conventions you've defined in
contributing.md
.Aside from the rework, the module should be published to npm at some point.