Skip to content

Commit

Permalink
Add more debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Nov 16, 2018
1 parent 5595ddf commit 032f1ec
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/util/config-comment-parser.js
Expand Up @@ -39,6 +39,8 @@ module.exports = class ConfigCommentParser {
* @returns {Object} Result map object of names and boolean values
*/
parseBooleanConfig(string, comment) {
debug("Parsing Boolean config");

const items = {};

// Collapse whitespace around `:` and `,` to make parsing easier
Expand Down Expand Up @@ -67,6 +69,8 @@ module.exports = class ConfigCommentParser {
* @returns {({success: true, config: Object}|{success: false, error: Problem})} Result map object
*/
parseJsonConfig(string, location) {
debug("Parsing JSON config");

let items = {};

// Parses a JSON-like comment by the same way as parsing CLI option.
Expand All @@ -85,6 +89,7 @@ module.exports = class ConfigCommentParser {
}
} catch (ex) {

debug("Levn parsing failed; falling back to manual parsing.");
// ignore to parse the string by a fallback.
}

Expand All @@ -98,6 +103,8 @@ module.exports = class ConfigCommentParser {
try {
items = JSON.parse(`{${normalizedString}}`);
} catch (ex) {
debug("Manual parsing failed.");

return {
success: false,
error: {
Expand All @@ -124,6 +131,8 @@ module.exports = class ConfigCommentParser {
* @returns {Object} Result map of values and true values
*/
parseListConfig(string) {
debug("Parsing list config");

const items = {};

// Collapse whitespace around commas
Expand Down

0 comments on commit 032f1ec

Please sign in to comment.