Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/flow-control/input-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class InputHandler implements FlowController {
input = data;
}

if (command && command.stdin) {
if (command?.stdin) {
command.stdin.write(input);
} else {
this.logger.logGlobalEvent(
Expand Down
6 changes: 3 additions & 3 deletions src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ export class Logger {
const endLength = Math.floor(prefixLength / 2);
const beginningLength = prefixLength - endLength;

const beginnning = text.slice(0, beginningLength);
const beginning = text.slice(0, beginningLength);
const end = text.slice(text.length - endLength, text.length);
return beginnning + ellipsis + end;
return beginning + ellipsis + end;
}

private getPrefixesFor(command: Command): Record<string, string> {
Expand Down Expand Up @@ -153,7 +153,7 @@ export class Logger {

colorText(command: Command, text: string) {
let color: chalk.Chalk;
if (command.prefixColor && command.prefixColor.startsWith('#')) {
if (command.prefixColor?.startsWith('#')) {
color = this.chalk.hex(command.prefixColor);
} else {
const defaultColor = _.get(this.chalk, defaults.prefixColors, this.chalk.reset);
Expand Down