Skip to content

Commit 44fe957

Browse files
committed
Fix coderabbit suggestion
1 parent 3924afc commit 44fe957

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/connect-react/src/hooks/form-context.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,13 @@ export const FormContextProvider = <T extends ConfigurableProps>({
188188
errs.push("not a boolean");
189189
}
190190
} else if (prop.type === "string") {
191-
interface StringProp extends ConfigurableProp {
191+
type StringProp = ConfigurableProp & {
192192
min?: number;
193193
max?: number;
194194
}
195-
const { min = 0, max } = prop as StringProp;
195+
const {
196+
min = 1, max,
197+
} = prop as StringProp;
196198
if (typeof value !== "string") {
197199
errs.push("not a string");
198200
} else {
@@ -203,12 +205,14 @@ export const FormContextProvider = <T extends ConfigurableProps>({
203205
errs.push(`string length must not exceed ${max} characters`);
204206
}
205207
}
206-
}
207208
} else if (prop.type === "app") {
208209
const field = fields[prop.name]
209210
if (field) {
210211
const app = field.extra.app
211-
const err = appPropError({ value, app })
212+
const err = appPropError({
213+
value,
214+
app,
215+
})
212216
if (err) errs.push(err)
213217
} else {
214218
errs.push("field not registered")

0 commit comments

Comments
 (0)