diff --git a/src/decode.ts b/src/decode.ts index 198bfdf..05e69c8 100644 --- a/src/decode.ts +++ b/src/decode.ts @@ -140,10 +140,8 @@ function mutatingSetSchemaDef( obj: T, props: K ): ProtoTypesWithSchemaInfo { - for (const prop of Object.keys(props)) { - ;(obj as any)[prop] = (props as any)[prop] - } - return obj as any + Object.assign(obj, props) + return obj as ProtoTypesWithSchemaInfo } // function mutatingOmit(obj: T, key: K): OmitUnion {