T[K] extends object
    ? DeepPartial&lt;T[K]&gt;
    : T[K]
}`)

const Result = Type.Script({ DeepPartial }, `DeepPartial&lt;{
  x: {
    y: { 
      z: 1
    }
  }
}&gt;`)                                                // const Result: TObject&lt;{
                                                    //   x: TOptional&lt;TObject&lt;{
                                                    //     y: TOptional&lt;TObject&lt;{
                                                    //       z: TOptional&lt;TLiteral&l