Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnath committed Mar 5, 2024
1 parent 38456e5 commit 205a9cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ export const intToString = (num) => {
* @param {Object} obj
* @returns {string} stringified object with quotes escaped
*/
export const stringify = (obj) => JSON.stringify(obj).replace(/"/g, "quot;");
export const stringify = (obj) => JSON.stringify(obj).replace(/"/g, "||||");

/**
* Parse a stringified object with quotes escaped
* @param {string} str
* @returns {Object} parsed object
*/
export const parseify = (str) => JSON.parse(str.replaceAll("quot;", '"'));
export const parseify = (str) => JSON.parse(str.replaceAll("||||", '"'));

0 comments on commit 205a9cd

Please sign in to comment.