Hello!
I ran into an issue with the branded JSON type.
Example:
@Column({ type: 'jsonb', nullable: true })
videos: JSONColumnType<{
[key: string]: {
size: number;
bitrate: number;
dimensions: number[];
resolution: number;
metadataSize: number;
};
}>;
But when we call Object.values(entity.videos), we get an unexpected type:
({
size: number;
bitrate: number;
dimensions: number[];
resolution: number;
metadataSize: number;
} | symbol)[]
The issue is the | symbol part. Because of this symbol in the union, we can't easily iterate — every access requires an additional if check.