Skip to content

Commit

Permalink
misc(utils): entry - variable parity
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruvdutt committed Mar 14, 2018
1 parent 3222ad3 commit 7dedd7d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/generators/utils/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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) {
Expand Down Expand Up @@ -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;
});
Expand Down

0 comments on commit 7dedd7d

Please sign in to comment.