Skip to content

Commit 3dbb502

Browse files
committed
Correcting minor stylistic issues that codacy reported
1 parent 2f40661 commit 3dbb502

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class ServerlessDynamodbLocal {
9696

9797
dynamodbOptions() {
9898
const { config } = this;
99-
const port = _.get(config, 'start.port', 8000);
99+
const port = _.get(config, "start.port", 8000);
100100
const dynamoOptions = {
101101
endpoint: `http://localhost:${port}`,
102102
region: "localhost",
@@ -113,15 +113,15 @@ class ServerlessDynamodbLocal {
113113
migrateHandler() {
114114
const dynamodb = this.dynamodbOptions();
115115
const { tables } = this;
116-
return BbPromise.each(tables, table => this.createTable(dynamodb, table));
116+
return BbPromise.each(tables, (table) => this.createTable(dynamodb, table));
117117
}
118118

119119
seedHandler() {
120120
const { doc: documentClient } = this.dynamodbOptions();
121121
const { seedSources } = this;
122122
return BbPromise.each(seedSources, source => {
123123
if (!source.table) {
124-
throw new Error("seeding source 'table' not defined");
124+
throw new Error("seeding source \"table\" property not defined");
125125
}
126126
return locateSeeds(source.sources || [])
127127
.then((seeds) => writeSeeds(documentClient, source.table, seeds));
@@ -163,7 +163,7 @@ class ServerlessDynamodbLocal {
163163
if (resources[key].Type === "AWS::DynamoDB::Table") {
164164
return resources[key].Properties;
165165
}
166-
}).filter(n => n);
166+
}).filter((n) => n);
167167
}
168168

169169
/**
@@ -174,11 +174,11 @@ class ServerlessDynamodbLocal {
174174
const seedConfig = _.get(config, "seed", {});
175175
const { seed } = this.options;
176176
if (!seed) {
177-
console.log("No seed option defined. Cannot seed data.")
177+
console.log("No seed option defined. Cannot seed data.");
178178
return [];
179179
}
180180
const categories = seed.split(",");
181-
const sourcesByCategory = categories.map(category => seedConfig[category].sources);
181+
const sourcesByCategory = categories.map((category) => seedConfig[category].sources);
182182
return [].concat.apply([], sourcesByCategory);
183183
}
184184

src/seeder.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function writeSeedBatch(dynamodb, tableName, seeds) {
4444
resolve();
4545
}
4646
}), interval);
47-
};
47+
}
4848
execute(interval);
4949
});
5050
}
@@ -70,7 +70,7 @@ function writeSeeds(dynamodb, tableName, seeds) {
7070
const seedChunks = _.chunk(seeds, MAX_MIGRATION_CHUNK);
7171
return BbPromise.map(
7272
seedChunks,
73-
chunk => writeSeedBatch(dynamodb, tableName, chunk),
73+
(chunk) => writeSeedBatch(dynamodb, tableName, chunk),
7474
{ concurrency: MIGRATION_SEED_CONCURRENCY }
7575
)
7676
.then(() => console.log("Seed running complete for table: " + tableName));

0 commit comments

Comments
 (0)