11 lines
468 B
JavaScript
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));
|
|
};
|
|
});
|