Merge pull request #4102 from nicosesma/refactor-MultiStats

Refactored MultiStats.js to ES6, as well as MultiStats.test.js WIP
This commit is contained in:
Tobias Koppers 2017-04-05 14:15:27 +02:00 committed by GitHub
commit abfe46779b
2 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@ const optionOrFallback = (optionValue, fallbackValue) => optionValue !== undefin
class MultiStats {
constructor(stats) {
this.stats = stats;
this.hash = stats.map((stat) => stat.hash).join("");
this.hash = stats.map(stat => stat.hash).join("");
}
hasErrors() {
@ -42,12 +42,12 @@ class MultiStats {
});
const obj = {
errors: jsons.reduce((arr, j) => {
return arr.concat(j.errors.map((msg) => {
return arr.concat(j.errors.map(msg => {
return `(${j.name}) ${msg}`;
}));
}, []),
warnings: jsons.reduce((arr, j) => {
return arr.concat(j.warnings.map((msg) => {
return arr.concat(j.warnings.map(msg => {
return `(${j.name}) ${msg}`;
}));
}, [])

View File

@ -5,7 +5,7 @@ const sinon = require("sinon");
const packageJSON = require("../package.json");
const MultiStats = require("../lib/MultiStats");
const createStat = function(overides) {
const createStat = overides => {
return Object.assign({
hash: "foo",
compilation: {