-
Notifications
You must be signed in to change notification settings - Fork 42
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
Issue 16 Adding a base object #27
Conversation
Also, would like to get your thoughts about how we are handling the response from the server in the individual API's. The ones in transmissions were wrapped and sending domains were not. I usually just pass the server response straight through. I want to be consistent with this. Appreciate your thoughts. |
|
||
// we need options | ||
if( !_.isPlainObject( options ) ) { | ||
throw new TypeError( 'options argument is required' ); |
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.
This error might want to mention that options
needs to be an object?
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.
Completely doable. I'm not the best at coming up with error messages. First thought was just to make them all return "seg fault". 😏
As for cycolmatic complexity, it doesn't look like that method is all that complex... I'd probably start by pulling this out into some kind of Lines 24 to 33 in c748b21
|
this.request( options, callback ); | ||
}; | ||
|
||
SparkPost.prototype['delete'] = function( options, callback ) { |
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.
isn't javascript fun :)
Just wanted to add as a general comment, I've noticed that there's some spacing going inside of function argument declarations, which we don't usually do. Like:
|
Sorry, the spacing was beaten into me at my last job. |
Issue 16 Adding a base object. Closes #16
Please look at this carefully. I would like as many eyes on it as possible. I've changed things around. The configuration library is gone. We now have a base client object with contained configs. I used the ExactTarget and Twilio node SDKs as inspiration. I also switched to using the nock library instead of our custom mocks.
Looking for suggestions to resolve this
Once this is in place, I should be able to quickly implement the rest of the APIs.
I appreciate all questions, suggestions, thoughts, limericks, what have you.