Hello,
can you help me how i can keep object keys hints when create new object
import type { TPropertyKey, TSchema } from '@sinclair/typebox';
export const createOptional = (list: Record<TPropertyKey, TSchema>) => {
return Object.fromEntries(Object.entries(list).map(([key, value]) => [key, Type.Optional(value)])) as Record<TPropertyKey, TOptional<TSchema>>;
}
const result = createOptional({ id: Type.String() });