Skip to content

Commit 3e8b992

Browse files
committed
style(mongoose): Add blank lines before returns following sibling statements
1 parent 3571281 commit 3e8b992

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/server-utils/src/mongoose/mongoose-dc-subscriber.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ function setupChannel(tracingChannel: MongooseTracingChannelFactory, channelName
141141
function getBatchSize(data: MongooseTracingData): number | undefined {
142142
const args = data.args;
143143
const batch = data.operation === 'insertMany' ? args?.docs : data.operation === 'bulkWrite' ? args?.ops : undefined;
144+
144145
return Array.isArray(batch) && batch.length > 1 ? batch.length : undefined;
145146
}
146147

@@ -159,6 +160,7 @@ function redactMongoQuery(value: unknown): string | undefined {
159160
try {
160161
const redacted = redactValue(value, 0);
161162
const text = JSON.stringify(redacted);
163+
162164
// Skip empty/uninformative shapes (e.g. a `findOne()` with no filter).
163165
return text == null || text === '{}' || text === '[]' ? undefined : text;
164166
} catch {
@@ -180,7 +182,9 @@ function redactValue(value: unknown, depth: number): unknown {
180182
for (const key of Object.keys(value as Record<string, unknown>)) {
181183
out[key] = redactValue((value as Record<string, unknown>)[key], depth + 1);
182184
}
185+
183186
return out;
184187
}
188+
185189
return '?';
186190
}

0 commit comments

Comments
 (0)