diff --git a/frontend/commands.js b/frontend/commands.js new file mode 100644 index 0000000..9b56de4 --- /dev/null +++ b/frontend/commands.js @@ -0,0 +1,10 @@ +(function (root, factory) { + const filterCommands = factory(); + if (typeof module === 'object' && module.exports) module.exports = filterCommands; + if (root) root.filterCommands = filterCommands; +})(typeof globalThis !== 'undefined' ? globalThis : this, function () { + return function filterCommands(commands, filter) { + const term = String(filter || '').toLowerCase(); + return commands.filter(command => command.name.toLowerCase().includes(term)); + }; +}); diff --git a/frontend/index.html b/frontend/index.html index 46c80ac..cc80af4 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -160,6 +160,7 @@ textarea { resize: vertical; min-height: 120px; }
+