Skip to content

Commit fc0a31f

Browse files
committed
Simplified splitPath type.
1 parent fef61d8 commit fc0a31f

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/lib/stringPath.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import type { FieldPath } from './index.js';
22

3-
export function splitPath<T extends object>(
4-
path: StringPath<T> | StringPathLeaves<T>
5-
) {
3+
export function splitPath<T extends object>(path: string) {
64
return path
75
.toString()
86
.split(/[[\].]+/)

src/lib/superValidate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function setError<T extends ZodValidation<AnyZodObject>>(
7878
? errArr
7979
: form.errors._errors.concat(errArr);
8080
} else {
81-
const realPath = splitPath(path);
81+
const realPath = splitPath(path as string);
8282

8383
const leaf = traversePath(
8484
form.errors,

0 commit comments

Comments
 (0)