Skip to content

Commit

Permalink
refactor: Replace _.head with array[0] (#7817)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisVillanueva committed Jun 8, 2020
1 parent a527744 commit 8991ceb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/utils/yamlAstParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const addNewArrayItem = (ymlFile, pathInYml, newValue) =>
}
currentNode[arrayPropertyName] = _.union(arrayProperty, [newValue]);

const branchToReplaceName = _.head(pathInYmlArray);
const branchToReplaceName = pathInYmlArray[0];
const newObject = {};
newObject[branchToReplaceName] = plainObject[branchToReplaceName];
const newText = yaml.dump(newObject);
Expand Down Expand Up @@ -155,7 +155,7 @@ const removeExistingArrayItem = (ymlFile, pathInYml, removeValue) =>
}
}

const headObjectPath = _.head(pathInYmlArray);
const headObjectPath = pathInYmlArray[0];
let newText = '';

if (plainObject[headObjectPath]) {
Expand Down

0 comments on commit 8991ceb

Please sign in to comment.