Skip to content

Commit

Permalink
Chore: combine multiple RegEx replaces with one (fixes #6669) (#6661)
Browse files Browse the repository at this point in the history
  • Loading branch information
thefourtheye authored and ilyavolodin committed Jul 15, 2016
1 parent 089ee2c commit 421e4bf
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,8 @@ var assert = require("assert"),
function parseBooleanConfig(string, comment) {
var items = {};

// Collapse whitespace around : to make parsing easier
string = string.replace(/\s*:\s*/g, ":");

// Collapse whitespace around ,
string = string.replace(/\s*,\s*/g, ",");
// Collapse whitespace around `:` and `,` to make parsing easier
string = string.replace(/\s*([:,])\s*/g, "$1");

string.split(/\s|,+/).forEach(function(name) {
if (!name) {
Expand Down

0 comments on commit 421e4bf

Please sign in to comment.