UNPKG

jsm-treeify

Version:

A library to display JavaScript objects as colorized, tree-like structures in the console.

15 lines (14 loc) 626 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const colorize_tree_1 = __importDefault(require("./colorize-tree")); /** * Transforms an object into a colored, tree-like string representation for console output. * * @param obj - The object to display as a tree. * @returns A formatted string representation of the object as a tree. */ const jsmTreeify = (obj) => '\n' + (0, colorize_tree_1.default)(obj).join('\n') + '\n'; exports.default = jsmTreeify;