MCPcopy Index your code
hub / github.com/CSSLint/csslint / readConfigData

Function readConfigData

src/cli/common.js:306–334  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

304 }
305
306 function readConfigData(config) {
307 var data = readConfigFile(config),
308 json,
309 optionName,
310 optionValue,
311 args,
312 options = {};
313 if (data) {
314 if (data.charAt(0) === "{") {
315 try {
316 json = JSON.parse(data);
317 data = "";
318 for (optionName in json) {
319 if (json.hasOwnProperty(optionName)) {
320 optionValue = json[optionName];
321 if (Array.isArray(optionValue)) {
322 optionValue = optionValue.join(",");
323 }
324 data += "--" + optionName + "=" + optionValue;
325 }
326 }
327 } catch (e) {}
328 }
329 args = data.replace(/\s+/g, "").split(/(?=--)/);
330 options = processArguments(args);
331 }
332
333 return options;
334 }
335
336 //-----------------------------------------------------------------------------
337 // Process command line

Callers 1

cliFunction · 0.85

Calls 2

readConfigFileFunction · 0.85
processArgumentsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…