Added JSON conversion tests and doc generation

This commit is contained in:
Mike Farah
2022-01-21 20:26:19 +11:00
parent e347090571
commit 2526b03d67
6 changed files with 367 additions and 3 deletions
+3 -3
View File
@@ -44,11 +44,11 @@ expression and prints the result in sequence.`,
}
func processExpression(expression string) string {
var prettyPrintExp = `(... | (select(tag != "!!str"), select(tag == "!!str") | select(test("(?i)^(y|yes|n|no|on|off)$") | not)) ) style=""`
if prettyPrint && expression == "" {
return prettyPrintExp
return yqlib.PrettyPrintExp
} else if prettyPrint {
return fmt.Sprintf("%v | %v", expression, prettyPrintExp)
return fmt.Sprintf("%v | %v", expression, yqlib.PrettyPrintExp)
}
return expression
}