@dcxp/root
Version:
DCX: Decentralized Credential Exchange. DWN protocol for verifiable credential exchange.
10 lines (7 loc) • 324 B
text/typescript
type JSONStringifyOptions = {
space?: string | number;
replacer?: (this: any, key: string, value: any) => any;
};
export const stringifier = (obj: any, options: JSONStringifyOptions = { space: 2 }) =>
JSON.stringify(obj, options.replacer, options.space);
export const parse = (strObj: string) => JSON.parse(strObj);