Skip to content

Commit

Permalink
Append wildcard character only when filter starts & ends with /
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Mar 14, 2024
1 parent 65b6753 commit 1cb190e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/js/logger-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -1341,9 +1341,7 @@ dom.on(document, 'keydown', ev => {
if ( reSchemeOnly.test(value) ) {
value = `|${value}`;
} else {
if ( value.endsWith('/') ) {
value += '*';
} else if ( /[/?]/.test(value) === false ) {
if ( /[/?]/.test(value) === false ) {
value += '^';
}
value = `||${value}`;
Expand Down Expand Up @@ -1415,7 +1413,8 @@ dom.on(document, 'keydown', ev => {
// Create static filter
if ( target.id === 'createStaticFilter' ) {
ev.stopPropagation();
const value = staticFilterNode().value;
const value = staticFilterNode().value
.replace(/^((?:@@)?\/.+\/)(\$|$)/, '$1*$2');
// Avoid duplicates
if ( createdStaticFilters.hasOwnProperty(value) ) { return; }
createdStaticFilters[value] = true;
Expand Down

0 comments on commit 1cb190e

Please sign in to comment.