MCPcopy Create free account
hub / github.com/auth0/auth0-cli / ColorizeJSON

Function ColorizeJSON

internal/ansi/ansi.go:49–57  ·  view source on GitHub ↗

ColorizeJSON returns a colorized version of the input JSON, if the writer supports colors.

(json string)

Source from the content-addressed store, hash-verified

47// ColorizeJSON returns a colorized version of the input JSON, if the writer
48// supports colors.
49func ColorizeJSON(json string) string {
50 if !shouldUseColors() {
51 return json
52 }
53
54 style := (*pretty.Style)(nil)
55
56 return string(pretty.Color([]byte(json), style))
57}
58
59// Faint returns slightly offset color text if the writer supports it.
60func Faint(text string) string {

Callers 7

JSONResultMethod · 0.92
JSONCompactResultMethod · 0.92
BrandingTextShowMethod · 0.92
BrandingTextUpdateMethod · 0.92
makeOrganizationViewFunction · 0.92
apiCmdRunFunction · 0.92
subscribeEventStreamCmdFunction · 0.92

Calls 1

shouldUseColorsFunction · 0.85

Tested by

no test coverage detected