Skip to content

Commit be6a960

Browse files
committed
refactor: implement two-phase PrintIR + Renderer for console/util.inspect
Refactors the logging library to use a two-phase approach: - Phase 1: Build intermediate representation (PrintIR enum) from JS values - Phase 2: Render IR to formatted string with formatting decisions This enables: - Shared codebase between console.log and util.inspect - Dynamic formatting based on breakLength/compact options - Better separation of concerns for future enhancements New files: - ir.rs: PrintIR enum for intermediate representation - builder.rs: Converts JS values to PrintIR - renderer.rs: Renders PrintIR to formatted strings Also adds util.inspect to API.md documentation.
1 parent 3b20c9a commit be6a960

File tree

5 files changed

+1509
-893
lines changed

5 files changed

+1509
-893
lines changed

API.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,8 @@ _Also available globally_
382382

383383
[inherits](https://nodejs.org/api/util.html#utilinheritsconstructor-superconstructor)
384384

385+
[inspect](https://nodejs.org/api/util.html#utilinspectobject-options)
386+
385387
[TextDecoder](https://nodejs.org/api/util.html#class-utiltextdecoder)
386388

387389
[TextEncoder](https://nodejs.org/api/util.html#class-utiltextdecoder)

0 commit comments

Comments
 (0)