-
Notifications
You must be signed in to change notification settings - Fork 18
Conversation
8dedca1
to
88a2c65
Compare
88a2c65
to
4d11f1a
Compare
// true, so only add it to the payload if it is truthy | ||
if (options.overwrite) { | ||
formData[name] = String(value); | ||
} |
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.
If I make a curl call with overwrite=false
, would the API interpret that value as truthy? If so, we should update our docs to make that clearer.
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.
yes
@@ -297,6 +297,14 @@ function prepareRequest(options) { | |||
case 'tempDir': { | |||
break; | |||
} | |||
case 'overwrite': { |
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.
Does this only apply to overwrite
, and not any of the other boolean flags?
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.
Only overwrite
as that's the only one that gets sent to the API. All of the other boolean args configure the behaviour of this module but don't get put in the payload.
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.
Looks good to me, tests are a nice addition to the project.
The only other thing that I think needs altering is the wording of our API docs, as IMO they imply that setting overwrite as "false" will not overwrite existing maps. https://docs.bugsnag.com/api/js-source-map-upload/
overwrite
parameter is not passed through to the API when it isfalse
(this is because the body is a URL encoded form sofalse
gets encoded as"false"
which is a truthy value!)The latter point addresses #23.