From 52928e0b9b6f03e31d38caf926295efccabb17c4 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Thu, 24 Aug 2023 10:48:51 +0200 Subject: [PATCH] fix(core): update --- ts/00_commitinfo_data.ts | 2 +- ts/index.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 6977b11..84b0805 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartjson', - version: '5.0.8', + version: '5.0.9', description: 'typed json handlers' } diff --git a/ts/index.ts b/ts/index.ts index 037d29e..4de7a10 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -21,6 +21,12 @@ export const stringify = ( 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): string => { const stringifiedResult = stringify(...args); return plugins.smartstring.base64.encodeUri(stringifiedResult);