clear name of contains arguments

This commit is contained in:
Alan Hamlett
2016-06-29 11:04:01 -07:00
parent 5731fd6625
commit 980990a593

View File

@@ -1,12 +1,12 @@
/** /**
* Creates an array from list using \n as delimiter * Creates an array from list using \n as delimiter
* and checks if the line is located in the list. * and checks if the str is located in the list.
* *
* @param line * @param str
* @param list * @param list
* @returns {boolean} * @returns {boolean}
*/ */
function contains(line, list) { function contains(str, list) {
var lines = list.split('\n'); var lines = list.split('\n');
for (var i = 0; i < lines.length; i ++) { for (var i = 0; i < lines.length; i ++) {
@@ -17,8 +17,8 @@ function contains(line, list) {
// If by any chance one line in the list is empty, ignore it // If by any chance one line in the list is empty, ignore it
if(cleanLine === '') continue; if(cleanLine === '') continue;
// If line contains the clean line return true // If current line contains the str return true
if (cleanLine.indexOf(line) > - 1) { if (cleanLine.indexOf(str) > -1) {
return true; return true;
} }
} }
@@ -26,4 +26,4 @@ function contains(line, list) {
return false; return false;
} }
module.exports = contains; module.exports = contains;