MCPcopy Index your code
hub / github.com/browserless/browserless / readFileOrNull

Function readFileOrNull

scripts/build-open-api.js:23–34  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

21const packageJSONPath = join(__dirname, '..', 'package.json');
22
23const readFileOrNull = async (path) => {
24 if (!path) {
25 return 'null';
26 }
27
28 try {
29 const content = await fs.readFile(path);
30 return content.toString();
31 } catch (e) {
32 return 'null';
33 }
34};
35
36const sortSwaggerRequiredAlpha = (prop, otherProp) => {
37 if (prop.required === otherProp.required) {

Callers 1

buildOpenAPIFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected