MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / readDataSourceConfigFromJSON

Function readDataSourceConfigFromJSON

packages/cli/lib/utils.js:671–684  ·  view source on GitHub ↗
(datasourcesDir, dataSourceClass)

Source from the content-addressed store, hash-verified

669}
670
671function readDataSourceConfigFromJSON(datasourcesDir, dataSourceClass) {
672 const datasourceJSONFile = path.join(
673 datasourcesDir,
674 exports.dataSourceToJSONFileName(dataSourceClass),
675 );
676
677 debug(`Reading datasource config from JSON file ${datasourceJSONFile}`);
678 try {
679 return JSON.parse(fs.readFileSync(datasourceJSONFile, 'utf8'));
680 } catch (err) {
681 err.message = `Cannot load ${datasourceJSONFile}: ${err.message}`;
682 throw err;
683 }
684}
685
686/**
687 *

Callers 1

utils.jsFile · 0.85

Calls 1

parseMethod · 0.65

Tested by

no test coverage detected