Skip to content

Commit

Permalink
Refactor remaining 'var' to 'let/const' usages (#959)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladikoff authored Jul 16, 2020
1 parent 7c82ef0 commit 436b865
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/Webhooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const Webhook = {
opts.secret
);

var generatedHeader = [
const generatedHeader = [
't=' + opts.timestamp,
opts.scheme + '=' + opts.signature,
].join(',');
Expand Down
3 changes: 2 additions & 1 deletion lib/makeRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ function getRequestOpts(self, requestArgs, spec, overrideData) {

function makeRequest(self, requestArgs, spec, overrideData) {
return new Promise((resolve, reject) => {
let opts;
try {
var opts = getRequestOpts(self, requestArgs, spec, overrideData);
opts = getRequestOpts(self, requestArgs, spec, overrideData);
} catch (err) {
reject(err);
return;
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const utils = (module.exports = {
/**
* Outputs a new function with interpolated object property values.
* Use like so:
* var fn = makeURLInterpolator('some/url/{param1}/{param2}');
* const fn = makeURLInterpolator('some/url/{param1}/{param2}');
* fn({ param1: 123, param2: 456 }); // => 'some/url/123/456'
*/
makeURLInterpolator: (() => {
Expand Down
4 changes: 2 additions & 2 deletions test/resources/BalanceTransactions.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

var stripe = require('../../testUtils').getSpyableStripe();
var expect = require('chai').expect;
const stripe = require('../../testUtils').getSpyableStripe();
const expect = require('chai').expect;

describe('BalanceTransactions Resource', function() {
describe('retrieve', function() {
Expand Down
4 changes: 2 additions & 2 deletions test/utils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -510,8 +510,8 @@ describe('utils', () => {
it('handles being unable to require `child_process`', () => {
utils._exec = null;

var actualErr = null;
var actualRes = null;
let actualErr = null;
let actualRes = null;
function myCb(err, res) {
actualErr = err;
actualRes = res;
Expand Down

0 comments on commit 436b865

Please sign in to comment.