diff --git a/src/js/parser/javascript/anchor.js b/src/js/parser/javascript/anchor.js index d59cfde..a5c46ba 100644 --- a/src/js/parser/javascript/anchor.js +++ b/src/js/parser/javascript/anchor.js @@ -1,8 +1,6 @@ export default { _render() { - return this.renderLabel(this.label).then(label => { - return label.addClass('anchor'); - }); + return this.renderLabel(this.label).then(label => label.addClass('anchor')); }, setup() { diff --git a/src/js/parser/javascript/charset.js b/src/js/parser/javascript/charset.js index a021126..465d482 100644 --- a/src/js/parser/javascript/charset.js +++ b/src/js/parser/javascript/charset.js @@ -28,9 +28,9 @@ export default { this.partContainer = this.container.group(); // Renders each part of the charset into the part container. - return Promise.all(_.map(this.elements, part => { - return part.render(this.partContainer.group()); - })) + return Promise.all(_.map(this.elements, + part => part.render(this.partContainer.group()) + )) .then(() => { // Space the parts of the charset vertically in the part container. util.spaceVertically(this.elements, { @@ -54,9 +54,8 @@ export default { // and text value of the part, so `[aa]` will have only one item, but // `[a\x61]` will contain two since the first matches "a" and the second // matches 0x61 (even though both are an "a"). - this.elements = _.uniqBy(this.properties.parts.elements, part => { - return `${part.type}:${part.textValue}`; - }); + this.elements = _.uniqBy(this.properties.parts.elements, + part => `${part.type}:${part.textValue}`); // Include a warning for charsets that attempt to match `\c` followed by // any character other than A-Z (case insensitive). Charsets like `[\c@]` diff --git a/src/js/parser/javascript/match.js b/src/js/parser/javascript/match.js index c01ed60..c951b23 100644 --- a/src/js/parser/javascript/match.js +++ b/src/js/parser/javascript/match.js @@ -33,9 +33,7 @@ export default { items; // Render each of the match fragments. - partPromises = _.map(this.parts, part => { - return part.render(this.container.group()); - }); + partPromises = _.map(this.parts, part => part.render(this.container.group())); items = _(partPromises).compact().value(); diff --git a/src/js/parser/javascript/regexp.js b/src/js/parser/javascript/regexp.js index 6974482..89fad23 100644 --- a/src/js/parser/javascript/regexp.js +++ b/src/js/parser/javascript/regexp.js @@ -15,9 +15,9 @@ export default { .translate(20, 0)); // Renders each match into the match container. - return Promise.all(_.map(this.matches, match => { - return match.render(matchContainer.group()); - })) + return Promise.all(_.map(this.matches, + match => match.render(matchContainer.group()) + )) .then(() => { let containerBox, paths; @@ -30,9 +30,7 @@ export default { containerBox = this.getBBox(); // Creates the curves from the side lines for each match. - paths = _.map(this.matches, match => { - return this.makeCurve(containerBox, match) - }); + paths = _.map(this.matches, match => this.makeCurve(containerBox, match)); // Add side lines to the list of paths. paths.push(this.makeSide(containerBox, _.first(this.matches))); @@ -46,9 +44,7 @@ export default { // Create connections from side lines to each match and render into // the match container. - paths = _.map(this.matches, match => { - return this.makeConnector(containerBox, match); - }); + paths = _.map(this.matches, match => this.makeConnector(containerBox, match)); matchContainer.prepend( matchContainer.path(paths.join(''))); }); @@ -124,10 +120,10 @@ export default { this.proxy = this.properties.match; } else { // Merge all the match nodes into one array. - this.matches = [this.properties.match] - .concat(_.map(this.properties.alternates.elements, element => { - return element.properties.match; - })); + this.matches = [this.properties.match].concat( + _.map(this.properties.alternates.elements, + element => element.properties.match) + ); } } }; diff --git a/src/js/parser/javascript/root.js b/src/js/parser/javascript/root.js index c50d720..b9e8004 100644 --- a/src/js/parser/javascript/root.js +++ b/src/js/parser/javascript/root.js @@ -47,9 +47,9 @@ export default { setup() { // Convert list of flags into text describing each flag. - this.flags = _(this.properties.flags.textValue).uniq().sort().map(flag => { - return this.flagLabels[flag]; - }).value(); + this.flags = _(this.properties.flags.textValue) + .uniq().sort() + .map(flag => this.flagLabels[flag]).value(); this.regexp = this.properties.regexp } diff --git a/src/js/parser/javascript/subexp.js b/src/js/parser/javascript/subexp.js index c4595ba..4c63439 100644 --- a/src/js/parser/javascript/subexp.js +++ b/src/js/parser/javascript/subexp.js @@ -38,12 +38,10 @@ export default { // Render the contained regexp. return this.regexp.render(this.container.group()) - .then(() => { - // Create the labeled box around the regexp. - return this.renderLabeledBox(label, this.regexp, { - padding: 10 - }); - }); + // Create the labeled box around the regexp. + .then(() => this.renderLabeledBox(label, this.regexp, { + padding: 10 + })); }, // Returns the label for the subexpression. diff --git a/src/js/regexper.js b/src/js/regexper.js index f9f61d9..6a6900d 100644 --- a/src/js/regexper.js +++ b/src/js/regexper.js @@ -183,9 +183,9 @@ export default class Regexper { // // - __warnings__ - Array of warning messages to display. displayWarnings(warnings) { - this.warnings.innerHTML = _.map(warnings, warning => { - return `