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:
parent
1cf087e5bc
commit
8768f653ac
48 changed files with 515 additions and 618 deletions
26
src/array.js
Normal file
26
src/array.js
Normal 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;
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue