From 53fe0182cbbaa43b17a6a98daf50fc4dda30a309 Mon Sep 17 00:00:00 2001 From: ASafaierad Date: Sun, 7 Jan 2024 22:35:07 +0100 Subject: [PATCH] fix: accept any type for parse input --- src/Config.ts | 4 ++-- src/types.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Config.ts b/src/Config.ts index 503a44b..7b60df6 100644 --- a/src/Config.ts +++ b/src/Config.ts @@ -11,7 +11,7 @@ import type { InferSchema, ObjectPath, Prettify, - RecursivePartial, + RecursiveAny, RequiredSchema, } from './types'; @@ -20,7 +20,7 @@ export class Config>> { constructor(private schema: TSchema) {} - public parse(value: RecursivePartial>) { + public parse(value: RecursiveAny>) { this.value = value as Record; Object.entries(this.schema).forEach(([key, s]) => { diff --git a/src/types.ts b/src/types.ts index 7e91190..d06c78f 100644 --- a/src/types.ts +++ b/src/types.ts @@ -66,6 +66,6 @@ export type GetPath = P extends keyof T : never : T; -export type RecursivePartial = { - [P in keyof T]?: RecursivePartial; -}; +export type RecursiveAny = T extends Record + ? { [P in keyof T]?: RecursiveAny } + : any;