Skip to content

Commit a48cb55

Browse files
committed
Fix lint
1 parent 269730a commit a48cb55

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/database/import.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export default class DatabaseImporter {
163163

164164
// Since we cannot PATCH arrays and primitives, we convert them to objects.
165165
private sanitizeDataForPatch(batch: Data): Data {
166-
if (typeof batch.json == "object") {
166+
if (typeof batch.json === "object") {
167167
return { json: { ...batch.json }, pathname: batch.pathname };
168168
} else {
169169
const tokens = batch.pathname.split("/");
@@ -233,16 +233,16 @@ class BatchChunks extends stream.Transform {
233233
this.batch = { json: {}, pathname: "" };
234234
this.size = 0;
235235
}
236-
if (this.size == 0) {
236+
if (this.size === 0) {
237237
this.batch = chunk;
238238
} else {
239239
const newPathname = this._findLongestCommonPrefix(chunk.pathname, this.batch.pathname);
240240
const batchKey = this.batch.pathname.substring(newPathname.length + 1); // +1 to trim leading slash
241241
const chunkKey = chunk.pathname.substring(newPathname.length + 1);
242242

243-
if (batchKey == "") {
243+
if (batchKey === "") {
244244
this.batch.json = Object.assign({}, this.batch.json, { [chunkKey]: chunk.json });
245-
} else if (chunkKey == "") {
245+
} else if (chunkKey === "") {
246246
this.batch.json = Object.assign({}, chunk.json, { [batchKey]: this.batch.json });
247247
} else {
248248
this.batch.json = { [batchKey]: this.batch.json, [chunkKey]: chunk.json };
@@ -258,7 +258,7 @@ class BatchChunks extends stream.Transform {
258258
const bTokens = b.split("/");
259259
let prefix = aTokens.slice(0, bTokens.length);
260260
for (let i = 0; i < prefix.length; i++) {
261-
if (prefix[i] != bTokens[i]) {
261+
if (prefix[i] !== bTokens[i]) {
262262
prefix = prefix.slice(0, i);
263263
break;
264264
}
@@ -268,7 +268,6 @@ class BatchChunks extends stream.Transform {
268268

269269
_flush(callback: stream.TransformCallback) {
270270
if (this.size > 0) {
271-
console.log(`flushed: ${JSON.stringify(this.batch.json)}, path: ${this.batch.pathname}`);
272271
this.push(this.batch);
273272
}
274273
callback(null);

0 commit comments

Comments
 (0)