Skip to content

Commit 24992eb

Browse files
author
Boyd, Zach
committed
Fixed linting issues
1 parent b402784 commit 24992eb

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

lib/stackops/snsEvents.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,22 +46,22 @@ module.exports = function(currentTemplate, aliasStackTemplates, currentAliasStac
4646
delete stageStack.Resources[name];
4747
});
4848

49-
const snsSubscriptions =
50-
_.assign({},
49+
const snsSubscriptions =
50+
_.assign({},
5151
_.pickBy(stageStack.Resources, [ 'Type', 'AWS::SNS::Subscription' ]));
5252

53-
_.forOwn(snsSubscriptions, (subscription, name) => {
53+
_.forOwn(snsSubscriptions, (subscription, name) => {
5454

55-
const functionNameRef = utils.findAllReferences(_.get(subscription.Properties, 'Endpoint'));
56-
const functionName = _.replace(_.get(functionNameRef, '[0].ref', ''), /LambdaFunction$/, '');
57-
const versionName = _.find(_.keys(versions), version => _.startsWith(version, functionName));
58-
const aliasName = _.find(_.keys(aliases), alias => _.startsWith(alias, functionName));
55+
const functionNameRef = utils.findAllReferences(_.get(subscription.Properties, 'Endpoint'));
56+
const functionName = _.replace(_.get(functionNameRef, '[0].ref', ''), /LambdaFunction$/, '');
57+
const versionName = _.find(_.keys(versions), version => _.startsWith(version, functionName));
58+
const aliasName = _.find(_.keys(aliases), alias => _.startsWith(alias, functionName));
5959

60-
subscription.Properties.Endpoint = { Ref: aliasName };
61-
subscription.DependsOn = [ versionName, aliasName ];
60+
subscription.Properties.Endpoint = { Ref: aliasName };
61+
subscription.DependsOn = [ versionName, aliasName ];
6262

63-
delete stageStack.Resources[name];
64-
});
63+
delete stageStack.Resources[name];
64+
});
6565

6666
// Fetch lambda permissions. These have to be updated later to allow the aliased functions.
6767
const snsLambdaPermissions =

test/stackops/snsEvents.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ describe('SNS Events', () => {
7575
return expect(awsAlias.aliasHandleSNSEvents({}, [], {})).to.be.fulfilled
7676
.then(() => BbPromise.all([
7777
expect(snsStack).to.not.have.a.nested.property('Resources.SNSTopicSlstestprojecttopic'),
78-
expect(snsStack).to.not.have.a.nested.property('Resources.SNSTopicSubscriptionSlstestprojecttopic'),
78+
expect(snsStack).to.not.have.a.nested.property('Resources.SNSTopicSubscriptionSlstestprojecttopic'),
7979
expect(snsStack).to.not.have.a.nested.property('Resources.Testfct1LambdaPermissionSlstestprojecttopicSNS'),
8080
expect(aliasStack).to.have.a.nested.property('Resources.SNSTopicSlstestprojecttopic'),
81-
expect(aliasStack).to.have.a.nested.property('Resources.SNSTopicSubscriptionSlstestprojecttopic'),
81+
expect(aliasStack).to.have.a.nested.property('Resources.SNSTopicSubscriptionSlstestprojecttopic'),
8282
expect(aliasStack).to.have.a.nested.property('Resources.Testfct1LambdaPermissionSlstestprojecttopicSNS'),
8383
]));
8484
});

0 commit comments

Comments
 (0)