mirror of https://github.com/webpack/webpack.git
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:
commit
abfe46779b
|
|
@ -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}`;
|
||||
}));
|
||||
}, [])
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue