@iola_adm/iola-cli 0.1.54 → 0.1.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli.js +7 -3
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -1285,9 +1285,13 @@ function printSlashMenu(filter = "", options = {}) {
|
|
|
1285
1285
|
|
|
1286
1286
|
function getSlashCommandMatches(filter = "") {
|
|
1287
1287
|
const normalized = String(filter || "").replace(/^\//, "").toLocaleLowerCase("ru-RU");
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1288
|
+
if (!normalized) return SLASH_COMMANDS;
|
|
1289
|
+
const commandPrefix = SLASH_COMMANDS.filter((item) => item.command.toLocaleLowerCase("ru-RU").startsWith(`/${normalized}`));
|
|
1290
|
+
if (commandPrefix.length > 0) return commandPrefix;
|
|
1291
|
+
const commandWordPrefix = SLASH_COMMANDS.filter((item) =>
|
|
1292
|
+
item.command.toLocaleLowerCase("ru-RU").split(/\s+/).some((part) => part.replace(/^\//, "").startsWith(normalized)));
|
|
1293
|
+
if (commandWordPrefix.length > 0) return commandWordPrefix;
|
|
1294
|
+
return SLASH_COMMANDS.filter((item) => item.description.toLocaleLowerCase("ru-RU").startsWith(normalized));
|
|
1291
1295
|
}
|
|
1292
1296
|
|
|
1293
1297
|
function updateSlashState(state) {
|