Skip to content

refactor: mark internal property as private for cleaner autocompletion #368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
16 changes: 8 additions & 8 deletions src/consola.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ const queue: any[] = [];
* @class Consola
*/
export class Consola {
options: ConsolaOptions;
private options: ConsolaOptions;

_lastLog: {
private _lastLog: {
serialized?: string;
object?: LogObject;
count?: number;
time?: Date;
timeout?: ReturnType<typeof setTimeout>;
};

_mockFn?: ConsolaOptions["mockFn"];
private _mockFn?: ConsolaOptions["mockFn"];

/**
* Creates an instance of Consola with specified options or defaults.
Expand Down Expand Up @@ -260,7 +260,7 @@ export class Consola {
this._wrapStream(this.options.stderr, "log");
}

_wrapStream(stream: NodeJS.WriteStream | undefined, type: LogType) {
private _wrapStream(stream: NodeJS.WriteStream | undefined, type: LogType) {
if (!stream) {
return;
}
Expand All @@ -284,7 +284,7 @@ export class Consola {
this._restoreStream(this.options.stderr);
}

_restoreStream(stream?: NodeJS.WriteStream) {
private _restoreStream(stream?: NodeJS.WriteStream) {
if (!stream) {
return;
}
Expand Down Expand Up @@ -340,7 +340,7 @@ export class Consola {
}
}

_wrapLogFn(defaults: InputLogObject, isRaw?: boolean) {
private _wrapLogFn(defaults: InputLogObject, isRaw?: boolean) {
return (...args: any[]) => {
if (paused) {
queue.push([this, defaults, args, isRaw]);
Expand All @@ -350,7 +350,7 @@ export class Consola {
};
}

_logFn(defaults: InputLogObject, args: any[], isRaw?: boolean) {
private _logFn(defaults: InputLogObject, args: any[], isRaw?: boolean) {
if (((defaults.level as number) || 0) > this.level) {
return false;
}
Expand Down Expand Up @@ -448,7 +448,7 @@ export class Consola {
resolveLog(true);
}

_log(logObj: LogObject) {
private _log(logObj: LogObject) {
for (const reporter of this.options.reporters) {
reporter.log(logObj, {
options: this.options,
Expand Down