UNPKG

615 BJavaScriptView Raw
1"use strict";
2// tslint:disable restrict-plus-operands
3Object.defineProperty(exports, "__esModule", { value: true });
4const tslib_1 = require("tslib");
5const chalk_1 = tslib_1.__importDefault(require("chalk"));
6const __1 = tslib_1.__importDefault(require(".."));
7function styledJSON(obj) {
8 let json = JSON.stringify(obj, null, 2);
9 if (!chalk_1.default.enabled) {
10 __1.default.info(json);
11 return;
12 }
13 let cardinal = require('cardinal');
14 let theme = require('cardinal/themes/jq');
15 __1.default.info(cardinal.highlight(json, { json: true, theme }));
16}
17exports.default = styledJSON;