8 lines
116 B
TypeScript
8 lines
116 B
TypeScript
|
export const parseJson = (json: string) => {
|
||
|
try {
|
||
|
return JSON.parse(json);
|
||
|
} catch (ex) {
|
||
|
return json;
|
||
|
}
|
||
|
};
|