This commit is contained in:
chaos 2024-11-10 16:51:38 +00:00
parent b6b3b29111
commit 9d285b6afd

View file

@ -121,7 +121,7 @@ def _encodeJSONValueColourCompact:
([
$value[] |
_encodeJSONValueColourCompact
] | join(",")) +
] | join(colourText(","; "array"))) +
colourText("]"; "array")
else
colourText("[]"; "array")
@ -139,7 +139,7 @@ def _encodeJSONValueColourCompact:
colourText($objectKey | tojson; "objectKey") +
":" +
($objectValue | _encodeJSONValueColourCompact)
] | join(",")) +
] | join(colourText(","; "object"))) +
colourText("}"; "object")
else
colourText("{}"; "object")
@ -178,7 +178,7 @@ def _encodeJSONValueColourPretty($indent; $currentDepth):
$value[] |
$nextDepthIndent +
_encodeJSONValueColourPretty($indent; $currentDepth + 1)
] | join("," + $currentIndentDepthNewline)) +
] | join(colourText(","; "array") + $currentIndentDepthNewline)) +
$currentIndentDepthNewline +
$currentIndentDepthIndent +
colourText("]"; "array")
@ -200,7 +200,7 @@ def _encodeJSONValueColourPretty($indent; $currentDepth):
colourText($objectKey | tojson; "objectKey") +
":" + $currentIndentDepthSpace +
($objectValue | _encodeJSONValueColourPretty($indent; $currentDepth + 1))
] | join("," + $currentIndentDepthNewline)) +
] | join(colourText(","; "object") + $currentIndentDepthNewline)) +
$currentIndentDepthNewline +
$currentIndentDepthIndent +
colourText("}"; "object")