User avatar
privTri Volpeon areonNSmol @volpeon@icy.wyvern.rip
1mo
I wrote a utility function just to circumvent this bullshit
export function elem<T>(arr: readonly T[], el: unknown): el is T {
	return (arr as unknown[]).includes(el);
}



A value of some unknown type is in the array? Now we know it must be type T. It isn't? Keep its original type, whatever it was.