stream interface, data handling logic

This commit is contained in:
Rupenieks
2020-05-19 15:19:35 +02:00
parent 6e0a8a143a
commit 110f368bca
4 changed files with 248 additions and 57 deletions

View File

@@ -52,3 +52,14 @@ export async function zulipApiRequest(this: IExecuteFunctions | IWebhookFunction
throw error;
}
}
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;
}