Skip to content

Commit d8e555f

Browse files
authored
Merge pull request #84 from minorcell/dev
fix: format code
2 parents 8702262 + 4a17ca9 commit d8e555f

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

‎.prettierignore‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
node_modules
2-
dist
2+
dist
3+
.next
4+
out
5+
coverage
6+
web/.next
7+
web/out

‎docs/tool/edit.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ Replaces target text in a file, with optional global replacement and batch edits
1313

1414
- `file_path` (string, required): target file path (normalized to absolute path).
1515
- Single-edit mode:
16-
- `old_string` (string, required): source text to replace.
17-
- `new_string` (string, required): replacement text.
18-
- `replace_all` (boolean, optional): whether to replace all occurrences; default is single replacement.
16+
- `old_string` (string, required): source text to replace.
17+
- `new_string` (string, required): replacement text.
18+
- `replace_all` (boolean, optional): whether to replace all occurrences; default is single replacement.
1919
- Batch mode:
20-
- `edits` (array, required in batch mode): each item has `old_string`, `new_string`, and optional `replace_all`.
21-
- `edits` cannot be used together with `old_string/new_string`.
20+
- `edits` (array, required in batch mode): each item has `old_string`, `new_string`, and optional `replace_all`.
21+
- `edits` cannot be used together with `old_string/new_string`.
2222

2323
## Behavior
2424

‎packages/tools/src/tools/edit.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ const EDIT_INPUT_SCHEMA = z
2222
})
2323
.superRefine((value, ctx) => {
2424
const hasBatch = Boolean(value.edits && value.edits.length > 0)
25-
const hasSingle = typeof value.old_string === 'string' || typeof value.new_string === 'string'
25+
const hasSingle =
26+
typeof value.old_string === 'string' || typeof value.new_string === 'string'
2627

2728
if (hasBatch && hasSingle) {
2829
ctx.addIssue({

0 commit comments

Comments
 (0)