mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-03-04 14:59:24 -05:00
8 lines
149 B
TypeScript
8 lines
149 B
TypeScript
export const safeJsonParse = (json: string | undefined | null) => {
|
|
try {
|
|
return JSON.parse(json ?? '')
|
|
} catch (e) {
|
|
return null
|
|
}
|
|
}
|