MCPcopy Index your code
hub / github.com/github/docs / readCompressedJsonFileFallback

Function readCompressedJsonFileFallback

lib/read-json-file.js:22–32  ·  view source on GitHub ↗
(xpath)

Source from the content-addressed store, hash-verified

20// staging deployment process will compress a bunch of large
21// `.json` files before packaging it up.
22export 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.

Callers 6

precompileRedirectsFunction · 0.90
getRestFunction · 0.90
getEnabledForAppsFunction · 0.90
getGraphqlSchemaFunction · 0.90
getWebhooksFunction · 0.90

Calls 2

readCompressedJsonFileFunction · 0.85
readJsonFileFunction · 0.85

Tested by

no test coverage detected