Skip to content

Commit

Permalink
refactor(command-interface): compact solution of how to transform Obj…
Browse files Browse the repository at this point in the history
…ects to Map
  • Loading branch information
Gerald Baulig committed Aug 8, 2024
1 parent 7688b0e commit b14c24a
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/command-interface/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,11 @@ export class CommandInterface implements CommandInterfaceServiceImplementation {
});

// check for buffer fields
this.bufferedCollection = new Map<string, string>();
if (this.config.get('fieldHandlers:bufferFields')) {
for (let bufferedCollection in this.config.get('fieldHandlers:bufferFields')) {
const buffFields = this.config.get('fieldHandlers:bufferFields');
this.bufferedCollection.set(bufferedCollection,
buffFields[bufferedCollection]);
}
this.logger.info('Buffered collections are:', this.bufferedCollection);
}
const buffFields = this.config.get('fieldHandlers:bufferFields') ?? {};
this.bufferedCollection = new Map<string, string>(
Object.entries(buffFields)
);
this.logger.info('Buffered collections are:', this.bufferedCollection);
}

/**
Expand Down

0 comments on commit b14c24a

Please sign in to comment.