MCPcopy Index your code
hub / github.com/darkreader/darkreader / readConfig

Function readConfig

tests/unit/config/config.tests.ts:14–24  ·  view source on GitHub ↗
(fileName: string)

Source from the content-addressed store, hash-verified

12import {rootPath} from '../../support/test-utils';
13
14function readConfig(fileName: string) {
15 return new Promise<string>((resolve, reject) => {
16 readFile(rootPath('src/config', fileName), {encoding: 'utf-8'}, (err, data) => {
17 if (err) {
18 reject(err);
19 return;
20 }
21 resolve(data);
22 });
23 });
24}
25
26function isURLPatternValid(url: string) {
27 return url.length > 0 && url.indexOf('://') < 0;

Callers 1

config.tests.tsFile · 0.85

Calls 2

rootPathFunction · 0.90
readFileFunction · 0.85

Tested by

no test coverage detected