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

Implemented Dom.remove

This commit is contained in:
Max Guglielmi 2015-12-06 00:37:59 +11:00
commit 086e25ee76
21 changed files with 123 additions and 117 deletions

View file

@ -29,11 +29,33 @@ export default {
return String(text).replace(chars, escMatch);
},
matchCase(text, mc){
if(!mc){
matchCase(text, caseSensitive){
if(!caseSensitive){
return this.lower(text);
}
return text;
},
/**
* Checks if passed data contains the searched term
* @param {String} term Searched term
* @param {String} data Data string
* @param {Boolean} exactMatch Exact match
* @param {Boolean} caseSensitive Case sensitive
* @return {Boolean}
*/
contains(term, data, exactMatch=false, caseSensitive=false){
// Improved by Cedric Wartel (cwl) automatic exact match for selects and
// special characters are now filtered
let regexp,
modifier = caseSensitive ? 'g' : 'gi';
if(exactMatch){
regexp = new RegExp(
'(^\\s*)'+ this.rgxEsc(term) +'(\\s*$)', modifier);
} else {
regexp = new RegExp(this.rgxEsc(term), modifier);
}
return regexp.test(data);
}
};