Simplify RegExp (#995)

Summary:
## Changelog
Pull Request resolved: https://github.com/facebook/flipper/pull/995

Reviewed By: passy

Differential Revision: D21112956

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 14d79dd399970c49835aab7eeb7dbd69ee323ab9
This commit is contained in:
shinpei_kim
2020-04-20 02:50:23 -07:00
committed by Facebook GitHub Bot
parent 21b79af5f2
commit ad6da949f7
10 changed files with 12 additions and 17 deletions

View File

@@ -275,10 +275,10 @@ export function parseCrashLog(
const fallbackReason = UNKNOWN_CRASH_REASON;
switch (os) {
case 'iOS': {
const regex = /Exception Type: *[\w]*/;
const regex = /Exception Type: *\w*/;
const arr = regex.exec(content);
const exceptionString = arr ? arr[0] : '';
const exceptionRegex = /[\w]*$/;
const exceptionRegex = /\w*$/;
const tmp = exceptionRegex.exec(exceptionString);
const exception = tmp && tmp[0].length ? tmp[0] : fallbackReason;