(xpath)
| 20 | // staging deployment process will compress a bunch of large |
| 21 | // `.json` files before packaging it up. |
| 22 | export function readCompressedJsonFileFallback(xpath) { |
| 23 | try { |
| 24 | return readCompressedJsonFile(xpath) |
| 25 | } catch (err) { |
| 26 | if (err.code === 'ENOENT') { |
| 27 | return readJsonFile(xpath) |
| 28 | } else { |
| 29 | throw err |
| 30 | } |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | // This is used to make sure the `readCompressedJsonFileFallbackLazily()` |
| 35 | // function isn't used with the same exact first argument more than once. |
no test coverage detected