Added shell string encoder (@sh) #1526

This commit is contained in:
Mike Farah
2023-02-02 12:23:08 +11:00
parent d119dbc239
commit d21bb920d6
7 changed files with 75 additions and 0 deletions
@@ -257,6 +257,15 @@ var encoderDecoderOperatorScenarios = []expressionScenario{
"D0, P[], (!!str)::this has & special () characters *\n",
},
},
{
description: "Encode a string to sh",
subdescription: "Sh/Bash friendly string",
document: "coolData: strings with spaces and a 'quote'",
expression: ".coolData | @sh",
expected: []string{
"D0, P[coolData], (!!str)::'strings with spaces and a \\'quote\\''\n",
},
},
{
description: "Decode a base64 encoded string",
subdescription: "Decoded data is assumed to be a string.",