@steve02081504/virtual-console 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/main.mjs +9 -0
  2. package/package.json +1 -1
package/main.mjs CHANGED
@@ -73,6 +73,15 @@ export class VirtualConsole extends Console {
73
73
  this.freshLine = this.freshLine.bind(this)
74
74
  this.error = this.error.bind(this)
75
75
  this.clear = this.clear.bind(this)
76
+ for (const method of ['log', 'info', 'warn', 'debug', 'error']) {
77
+ if (!this[method]) continue
78
+ const originalMethod = this[method]
79
+ this[method] = (...args) => {
80
+ if (!this.options.realConsoleOutput || this.options.recordOutput) return originalMethod.apply(this, args)
81
+ this.#loggedFreshLineId = null
82
+ return this.#base_console[method](...args)
83
+ }
84
+ }
76
85
  }
77
86
 
78
87
  get base_console() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steve02081504/virtual-console",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "A virtual console for capturing and manipulating terminal output.",
5
5
  "main": "main.mjs",
6
6
  "type": "module",