Updated to pass eslint

This commit is contained in:
Keith Carangelo 2021-09-08 15:40:05 -04:00
parent a7d43caccb
commit 6202038c65

View file

@ -47,14 +47,14 @@ function createAwesompleteInstance(element, separator, tags = []) {
// Tags are separated by separator. Ignore leading search flags // Tags are separated by separator. Ignore leading search flags
awesome.filter = (text, input) => { awesome.filter = (text, input) => {
let filter_func = Awesomplete.FILTER_CONTAINS; let filterFunc = Awesomplete.FILTER_CONTAINS;
let input_flagged = input.replace( /^[\-\~\+]/, '' ); const inputFlagged = input.replace(/^[-~+]/, '');
if (input !== input_flagged) { if (input !== inputFlagged) {
input = input_flagged; input = inputFlagged;
filter_func = Awesomplete.FILTER_STARTSWITH; filterFunc = Awesomplete.FILTER_STARTSWITH;
} }
return filter_func(text, input.match(new RegExp(`[^${separator}]*$`))[0]); return filterFunc(text, input.match(new RegExp(`[^${separator}]*$`))[0]);
}; };
// Insert new selected tag in the input // Insert new selected tag in the input