mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-19 05:59:34 +02:00
8 lines
212 B
TypeScript
8 lines
212 B
TypeScript
export const escapeJson = (input: string, wrapInQuotesFlag: boolean) => {
|
|
const escapedJson = JSON.stringify(input);
|
|
if (!wrapInQuotesFlag) {
|
|
return escapedJson.slice(1, -1);
|
|
}
|
|
return escapedJson;
|
|
};
|