Skip to content

Commit

Permalink
Improve args check to support optional params for makeRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
cjavilla-stripe committed Mar 3, 2020
1 parent b574444 commit dc75e59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/makeRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function getRequestOpts(self, requestArgs, spec, overrideData) {
const options = utils.getOptionsFromArgs(args);

// Validate that there are no more args.
if (args.length) {
if (args.filter((x) => x !== undefined && x !== null).length) {
throw new Error(
`Stripe: Unknown arguments (${args}). Did you mean to pass an options object? See https://github.com/stripe/stripe-node/wiki/Passing-Options. (on API request to ${requestMethod} \`${path}\`)`
);
Expand Down

0 comments on commit dc75e59

Please sign in to comment.