Skip to content

Commit

Permalink
0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lgc2333 committed Feb 16, 2024
1 parent 94abb24 commit 096c381
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "form-api-ex",
"version": "0.4.0",
"version": "0.4.1",
"description": "Work with LLSE forms easily!",
"main": "lib/FormAPIEx.cjs",
"module": "lib/FormAPIEx.mjs",
Expand Down
4 changes: 4 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@ QQ:3076823485

## 更新日志

### 0.4.1

- 修复 `SimpleFormEx` 的默认 `searcher` 的一些问题

### 0.4.0

- 新增 `SimpleFormOperational`
Expand Down
9 changes: 6 additions & 3 deletions src/simple-ex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ export class SimpleFormEx<T> {
buttons,
param
): T[] => {
const params = param.split(/\s/g);
const formatted = this.formatButtons(buttons).map((v) => v[0]);
const params = param.toLowerCase().split(/\s/g);
const formatted = this.formatButtons(buttons).map((v) =>
v[0].toLowerCase()
);
const result: T[] = [];
formatted.forEach((v, i) => {
for (const wd of params) {
if (v.includes(wd)) result.push(buttons[i]);
const btn = buttons[i];
if (v.includes(wd) && !result.includes(btn)) result.push(btn);
}
});
return result;
Expand Down
2 changes: 1 addition & 1 deletion tooth.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://raw.githubusercontent.com/lippkg/lip/main/schemas/tooth.v2.schema.json",
"format_version": 2,
"tooth": "github.com/lgc-LLDev/FormAPIEx",
"version": "0.4.0",
"version": "0.4.1",
"info": {
"name": "FormAPIEx",
"description": "Work with LSE forms easily!",
Expand Down

0 comments on commit 096c381

Please sign in to comment.