(source: any, absPath: any)
| 495 | } |
| 496 | |
| 497 | function tryToParseFile(source: any, absPath: any) { |
| 498 | try { |
| 499 | return recast.parse(source, { parser }); |
| 500 | } catch (e1: any) { |
| 501 | let options; |
| 502 | try { |
| 503 | options = JSON.parse( |
| 504 | fs |
| 505 | .readFileSync(path.join(path.dirname(absPath), "options.json")) |
| 506 | .toString(), |
| 507 | ); |
| 508 | } catch (e2: any) { |
| 509 | if (e2.code !== "ENOENT") { |
| 510 | console.error(e2); |
| 511 | } |
| 512 | throw e1; |
| 513 | } |
| 514 | |
| 515 | if (options.throws === e1.message) { |
| 516 | return null; |
| 517 | } |
| 518 | |
| 519 | throw e1; |
| 520 | } |
| 521 | } |
no test coverage detected
searching dependent graphs…