Skip to content

Commit

Permalink
add tp as a constructor (#29)
Browse files Browse the repository at this point in the history
Co-authored-by: Sergey Sergeev <[email protected]>
  • Loading branch information
zhirafovod and Sergey Sergeev authored Dec 13, 2023
1 parent a86478a commit a5bd68e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/CliCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export default class CliCore {
private currentDirectory:string;
replServer:repl.REPLServer;

constructor() {
this.templateProcessor = null;
constructor(templateProcessor: TemplateProcessor = null) {
this.templateProcessor = templateProcessor;
this.logLevel = "info";
this.currentDirectory = path.join(process.cwd(), 'example'); // Default to cwd/example
}
Expand Down
5 changes: 3 additions & 2 deletions src/StatedREPL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ import CliCore from './CliCore.js';
import colorizeJson from "json-colorizer";
import chalk from 'chalk';
import { circularReplacer, stringifyTemplateJSON } from './utils/stringify.js';
import TemplateProcessor from "./TemplateProcessor.js";


export default class StatedREPL {
private readonly cliCore: CliCore;
r: repl.REPLServer;
private isColorized:boolean;
constructor() {
this.cliCore = new CliCore();
constructor(temaplateProcessor: TemplateProcessor = null) {
this.cliCore = new CliCore(temaplateProcessor);
}

async initialize() {
Expand Down

0 comments on commit a5bd68e

Please sign in to comment.