This commit is contained in:
Ricardo Espinoza
2019-11-14 18:44:07 -05:00
parent a3594ae7a2
commit 451c87d8a9
3 changed files with 458 additions and 7 deletions

View File

@@ -41,3 +41,13 @@ export async function mailchimpApiRequest(this: IHookFunctions | IExecuteFunctio
throw error.response.body;
}
}
export function validateJSON(json: string | undefined): any { // tslint:disable-line:no-any
let result;
try {
result = JSON.parse(json!);
} catch (exception) {
result = '';
}
return result;
}