Skip to content

Commit

Permalink
fix: accept any type for parse input
Browse files Browse the repository at this point in the history
  • Loading branch information
ASafaeirad committed Apr 13, 2024
1 parent ea092fc commit a1be413
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
InferSchema,
ObjectPath,
Prettify,
RecursivePartial,
RecursiveAny,
RequiredSchema,
} from './types';

Expand All @@ -20,7 +20,7 @@ export class Config<TSchema extends Record<string, Schema<any, any, boolean>>> {

constructor(private schema: TSchema) {}

public parse(value: RecursivePartial<InferSchema<TSchema>>) {
public parse(value: RecursiveAny<InferSchema<TSchema>>) {
this.value = value as Record<keyof TSchema, any>;

Object.entries(this.schema).forEach(([key, s]) => {
Expand Down
6 changes: 3 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ export type GetPath<T, P extends string> = P extends keyof T
: never
: T;

export type RecursivePartial<T> = {
[P in keyof T]?: RecursivePartial<T[P]>;
};
export type RecursiveAny<T> = T extends Record<string, unknown>
? { [P in keyof T]?: RecursiveAny<T[P]> }
: any;

0 comments on commit a1be413

Please sign in to comment.