Skip to content

Commit

Permalink
feat: Add function escape_json
Browse files Browse the repository at this point in the history
  • Loading branch information
marverix committed Feb 3, 2025
1 parent 2ab771e commit 80bec06
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/json_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@
function is_json() {
echo "$1" | jq . >/dev/null 2>&1
}

function escape_json() {
local x=$(echo "$1" | sed -e 's/"/\\"/g')
echo $x
}

0 comments on commit 80bec06

Please sign in to comment.