Skip to content

Commit

Permalink
refactor: use tab-indented JSON.stringify for readability in useDataS…
Browse files Browse the repository at this point in the history
…aver
  • Loading branch information
p-eye committed Dec 22, 2024
1 parent 7ec3884 commit 641226f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/lib/hooks/useDataSaver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ const useDataSaver = (
const copyToClipboard = () => {
if (navigator.clipboard) {
const str =
typeof data === 'string' ? String(data) : JSON.stringify(data);
typeof data === 'string'
? String(data)
: JSON.stringify(data, null, '\t');
navigator.clipboard.writeText(str);
showSuccessAlert({
id: subject,
Expand Down

0 comments on commit 641226f

Please sign in to comment.