Skip to content

Commit

Permalink
Merge pull request #627 from jembi/feat/format-custom-json-content
Browse files Browse the repository at this point in the history
Allow for beautification of custom json header
  • Loading branch information
drizzentic authored Sep 20, 2024
2 parents b403f98 + e7e76ad commit 75c1981
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/scripts/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ export function beautifyIndent (type, content) {
if (/.*application\/\w+\+xml.*/.test(type)) {
return { lang: 'xml', content: pd.xml(content, 2) }
}

// application/{word characters}+json.
if (/application\/\w+\+json/.test(type)) {
return { lang: 'json', content: pd.json(content, 2) }
}
} catch (err) {
console.log(err)
return { lang: '', content }
Expand Down

0 comments on commit 75c1981

Please sign in to comment.