Skip to content

Commit 1d6eef6

Browse files
gagikaddaleax
andauthored
refactor: combine if statement
Co-authored-by: Anna Henningsen <[email protected]>
1 parent 99145d1 commit 1d6eef6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/mongodb-log-writer/src/mongo-log-manager.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ export class MongoLogManager {
3636
_options: MongoLogOptions;
3737

3838
constructor(options: MongoLogOptions) {
39-
if (options.prefix) {
40-
if (!/^[a-z0-9_]+$/i.test(options.prefix)) {
39+
if (options.prefix && !/^[a-z0-9_]+$/i.test(options.prefix)) {
4140
throw new Error(
4241
'Prefix must only contain letters, numbers, and underscores'
4342
);

0 commit comments

Comments
 (0)