n8n/packages/nodes-base/nodes/Slack/GenericFunctions.ts

11 lines
209 B
TypeScript
Raw Normal View History

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;
}