You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
326 B
11 lines
326 B
var idxOf = require('./idxOf'); |
|
var isStr = require('./isStr'); |
|
var isArrLike = require('./isArrLike'); |
|
var values = require('./values'); |
|
exports = function(arr, val) { |
|
if (isStr(arr)) return arr.indexOf(val) > -1; |
|
if (!isArrLike(arr)) arr = values(arr); |
|
return idxOf(arr, val) >= 0; |
|
}; |
|
|
|
module.exports = exports;
|
|
|