1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2026-03-16 15:45:45 +01:00

Started filtersVisibility extension

This commit is contained in:
Max Guglielmi 2015-06-06 20:06:15 +10:00
commit 8768f653ac
48 changed files with 515 additions and 618 deletions

26
src/array.js Normal file
View file

@ -0,0 +1,26 @@
/**
* Array utilities
*/
import Str from './string';
export default {
has: function(arr, val, caseSensitive){
let sCase = caseSensitive===undefined ? false : caseSensitive;
for (var i=0; i<arr.length; i++){
if(Str.matchCase(arr[i].toString(), sCase) == val){
return true;
}
}
return false;
},
indexByValue: function(arr, val, caseSensitive){
let sCase = caseSensitive===undefined ? false : caseSensitive;
for (var i=0; i<arr.length; i++){
if(Str.matchCase(arr[i].toString(), sCase) == val){
return i;
}
}
return -1;
}
};