Skip to content

Commit 19c8cc2

Browse files
dahliacodex
andcommitted
Validate lookup.recurseDepth config as positive integer
Align config validation with CLI option constraints for --recurse-depth. Ref: fedify-dev#608 (comment) Co-Authored-By: OpenAI Codex <codex@openai.com>
1 parent 23574ef commit 19c8cc2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/cli/src/config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,13 @@ import {
77
array,
88
boolean,
99
type InferOutput,
10+
integer,
11+
minValue,
1012
number,
1113
object,
1214
optional,
1315
picklist,
16+
pipe,
1417
string,
1518
} from "valibot";
1619

@@ -37,7 +40,7 @@ const lookupSchema = object({
3740
"https://www.w3.org/ns/activitystreams#inReplyTo",
3841
]),
3942
),
40-
recurseDepth: optional(number()),
43+
recurseDepth: optional(pipe(number(), integer(), minValue(1))),
4144
suppressErrors: optional(boolean()),
4245
defaultFormat: optional(picklist(["default", "raw", "compact", "expand"])),
4346
separator: optional(string()),

0 commit comments

Comments
 (0)