Skip to content

Commit 1c706b6

Browse files
committed
feat: match asterisks
Fixes #21
1 parent c710b57 commit 1c706b6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

out/command-table.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ function searchCommands() {
66
let commandName = command.children[0].textContent.toLowerCase();
77
let commandType = command.children[1].textContent.toLowerCase();
88
let commandDescription = command.children[2].textContent.toLowerCase();
9+
let match = false;
910
if (commandName.includes(query) || commandType.includes(query) || commandDescription.includes(query)) {
11+
match = true;
12+
}
13+
if (commandName.endsWith('*') && query.startsWith(commandName.slice(0, -1))) {
14+
match = true;
15+
}
16+
if (match) {
1017
anyMatch = true;
1118
command.classList.remove('hidden');
1219
} else {

0 commit comments

Comments
 (0)