fix(core): update

This commit is contained in:
Philipp Kunz 2023-08-24 10:48:51 +02:00
parent 00ae980fa7
commit 52928e0b9b
2 changed files with 7 additions and 1 deletions

View File

@ -3,6 +3,6 @@
*/ */
export const commitinfo = { export const commitinfo = {
name: '@push.rocks/smartjson', name: '@push.rocks/smartjson',
version: '5.0.8', version: '5.0.9',
description: 'typed json handlers' description: 'typed json handlers'
} }

View File

@ -21,6 +21,12 @@ export const stringify = (
return returnJson; return returnJson;
}; };
export const stringifyPretty = (objectArg: any) => {
const stringified = stringify(objectArg);
const object = JSON.parse(stringified);
return JSON.stringify(object, null, 2);
}
export const stringifyBase64 = (...args: Parameters<typeof stringify>): string => { export const stringifyBase64 = (...args: Parameters<typeof stringify>): string => {
const stringifiedResult = stringify(...args); const stringifiedResult = stringify(...args);
return plugins.smartstring.base64.encodeUri(stringifiedResult); return plugins.smartstring.base64.encodeUri(stringifiedResult);