Skip to content

Commit

Permalink
Simplified splitPath type.
Browse files Browse the repository at this point in the history
  • Loading branch information
ciscoheat committed Jun 29, 2023
1 parent fef61d8 commit fc0a31f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/lib/stringPath.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { FieldPath } from './index.js';

export function splitPath<T extends object>(
path: StringPath<T> | StringPathLeaves<T>
) {
export function splitPath<T extends object>(path: string) {
return path
.toString()
.split(/[[\].]+/)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/superValidate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function setError<T extends ZodValidation<AnyZodObject>>(
? errArr
: form.errors._errors.concat(errArr);
} else {
const realPath = splitPath(path);
const realPath = splitPath(path as string);

const leaf = traversePath(
form.errors,
Expand Down

0 comments on commit fc0a31f

Please sign in to comment.