clear name of contains arguments
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user