UNPKG

bugsplat

Version:
18 lines 697 B
const isObject = (val) => typeof val === 'object' && val !== null; const isString = (val) => typeof val === 'string'; const isNumber = (val) => typeof val === 'number'; const isUndefined = (val) => val === undefined; export function validateResponseBody(response) { if (!isObject(response)) { return false; } const conditions = [ ['success', 'fail'].includes(response['status']), isNumber(response['current_server_time']), isString(response['message']), isString(response['url']) || isUndefined(response['url']), isNumber(response['crash_id']), ]; return conditions.every(Boolean); } //# sourceMappingURL=bugsplat-response.js.map