mirror of
https://github.com/unraid/api.git
synced 2026-04-25 00:39:09 -05:00
010efe75bd
This reverts commit 4ef387b5bb.
8 lines
149 B
TypeScript
8 lines
149 B
TypeScript
export const attemptJSONParse = (text: string, fallback: any = undefined) => {
|
|
try {
|
|
return JSON.parse(text);
|
|
} catch {
|
|
return fallback;
|
|
}
|
|
};
|