s2terminal/i-read-u

View on GitHub
src/classes/section.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Command } from "./command";

export class Section {
  public commands: Command[];

  public constructor(private headerRawString: string, private headerLevel: number) {
    this.commands = [];
  }

  public push(command: Command): Section {
    this.commands.push(command);
    return this;
  }

  public renderHeader(): string {
    return `${"#".repeat(this.headerLevel)} ${this.headerRawString}`;
  }
}