diff --git a/lib/generators/utils/entry.js b/lib/generators/utils/entry.js index bf6b158a948..6cd6aa89602 100644 --- a/lib/generators/utils/entry.js +++ b/lib/generators/utils/entry.js @@ -9,7 +9,7 @@ const validate = require("./validate"); * * @param {Object} self - A variable holding the instance of the prompting * @param {Object} answer - Previous answer from asking if the user wants single or multiple entries - * @returns {Object} An Object that holds the answers given by the user, later used to scaffold + * @returns {Object} An Object that holds the answers given by the user, later used to scaffold */ module.exports = (self, answer) => { @@ -28,7 +28,7 @@ module.exports = (self, answer) => { let webpackEntryPoint = {}; entryIdentifiers = multipleEntriesAnswer["multipleEntries"].split(","); function forEachPromise(obj, fn) { - return obj.reduce(function(promise, prop) { + return obj.reduce((promise, prop) => { const trimmedProp = prop.trim(); return promise.then(n => { if (n) { @@ -59,18 +59,18 @@ module.exports = (self, answer) => { validate ) ]) - ).then(propAns => { - Object.keys(propAns).forEach(val => { + ).then(entryPropAnswer => { + Object.keys(entryPropAnswer).forEach(val => { if ( - propAns[val].charAt(0) !== "(" && - propAns[val].charAt(0) !== "[" && - propAns[val].indexOf("function") < 0 && - propAns[val].indexOf("path") < 0 && - propAns[val].indexOf("process") < 0 + entryPropAnswer[val].charAt(0) !== "(" && + entryPropAnswer[val].charAt(0) !== "[" && + entryPropAnswer[val].indexOf("function") < 0 && + entryPropAnswer[val].indexOf("path") < 0 && + entryPropAnswer[val].indexOf("process") < 0 ) { - propAns[val] = `"${propAns[val]}.js"`; + entryPropAnswer[val] = `"${entryPropAnswer[val]}.js"`; } - webpackEntryPoint[val] = propAns[val]; + webpackEntryPoint[val] = entryPropAnswer[val]; }); return webpackEntryPoint; });