mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-27 05:29:42 -08:00
11 lines
209 B
TypeScript
11 lines
209 B
TypeScript
|
|
export function validateJSON(json: string | undefined): any { // tslint:disable-line:no-any
|
|
let result;
|
|
try {
|
|
result = JSON.parse(json!);
|
|
} catch (exception) {
|
|
result = undefined;
|
|
}
|
|
return result;
|
|
}
|