diff --git a/src/typebox.ts b/src/typebox.ts index 0befe77..bb7f381 100644 --- a/src/typebox.ts +++ b/src/typebox.ts @@ -289,11 +289,15 @@ type ReadonlyPropertyKeys = { [K in keyof T]: T[K] extends TReadonly type OptionalPropertyKeys = { [K in keyof T]: T[K] extends TOptional ? K : never }[keyof T] type PropertyKeys = keyof Omit | ReadonlyPropertyKeys> -type StaticObjectProperties = +type StaticObjectPropertiesExpansion = { readonly [K in ReadonlyPropertyKeys]: Static } & { [K in OptionalPropertyKeys]?: Static } & { [K in PropertyKeys]: Static } +type StaticObjectProperties = { + [K in keyof StaticObjectPropertiesExpansion]: StaticObjectPropertiesExpansion[K] +} + type StaticSchema = T extends TObject ? StaticObjectProperties : T extends TMap ? { [key: string]: Static } :