Skip to content

Commit

Permalink
Drop support for optional url params
Browse files Browse the repository at this point in the history
  • Loading branch information
rattrayalex-stripe committed May 10, 2019
1 parent 17f1281 commit b8cbd25
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions lib/makeRequest.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

const utils = require('./utils');
const OPTIONAL_REGEX = /^optional!/;

function getRequestOpts(self, requestArgs, spec, overrideData) {
// Extract spec values with defaults.
Expand All @@ -28,9 +27,6 @@ function getRequestOpts(self, requestArgs, spec, overrideData) {

let param = urlParams[i];

const isOptional = OPTIONAL_REGEX.test(param);
param = param.replace(OPTIONAL_REGEX, '');

if (param == 'id' && typeof arg !== 'string') {
path = self.createResourcePathWithSymbols(spec.path);
throw new Error(
Expand All @@ -39,11 +35,6 @@ function getRequestOpts(self, requestArgs, spec, overrideData) {
}

if (!arg) {
if (isOptional) {
urlData[param] = '';
continue;
}

path = self.createResourcePathWithSymbols(spec.path);
throw new Error(
`Stripe: Argument "${
Expand Down

0 comments on commit b8cbd25

Please sign in to comment.