stackchain-dashboard/frontend/commands.js
timmy 3e1ce3e72a
All checks were successful
CI / lint (pull_request) Successful in 7s
CI / build-frontend (pull_request) Successful in 4s
fix: preserve filtered command actions (#60)
2026-08-06 01:48:09 +00:00

11 lines
468 B
JavaScript

(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));
};
});