diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/search.js b/packages/node_modules/@node-red/editor-client/src/js/ui/search.js index d8035908a..7d147bde9 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/search.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/search.js @@ -125,8 +125,8 @@ RED.search = (function() { } function search(val) { - var results = []; - var flags = {}; + const results = []; + const flags = {}; val = extractFlag(val,"invalid",flags); val = extractFlag(val,"unused",flags); val = extractFlag(val,"config",flags); @@ -137,7 +137,8 @@ RED.search = (function() { val = extractValue(val,"uses",flags);// uses: val = extractType(val,flags);// uses: val = val.trim(); - var hasFlags = Object.keys(flags).length > 0; + const hasFlags = Object.keys(flags).length > 0; + const hasTypeFilter = flags.type && flags.type.length > 0 if (flags.flow && flags.flow.indexOf("current") >= 0) { let idx = flags.flow.indexOf("current"); flags.flow[idx] = RED.workspaces.active();//convert 'current' to active flow ID @@ -145,13 +146,12 @@ RED.search = (function() { if (flags.flow && flags.flow.length) { flags.flow = [ ...new Set(flags.flow) ]; //deduplicate } - const hasTypeFilter = flags.type && flags.type.length > 0 if (val.length > 0 || hasFlags) { val = val.toLowerCase(); - var i; - var j; - var list = []; - var nodes = {}; + let i; + let j; + let list = []; + const nodes = {}; let keys = []; if (flags.uses) { keys = flags.uses; @@ -159,10 +159,10 @@ RED.search = (function() { keys = Object.keys(index); } for (i=0;i -1 || (val === "" && hasTypeFilter)) { - var ids = Object.keys(index[key]||{}); + const key = keys[i]; + const kpos = val ? keys[i].indexOf(val) : -1; + if (kpos > -1 || (val === "" && hasFlags)) { + const ids = Object.keys(index[key]||{}); for (j=0;j