79540860

Date: 2025-03-28 08:22:37
Score: 0.5
Natty:
Report link

It works for me:

type NoArray<T> = T extends Array<any> ? never : T;

const obj: NoArray<{length: number}> = {length: 123}; // works fine
const arr: NoArray<[{length: number}]> = [{length: 123}]; // TypeError

TS playground link

Reasons:
  • Whitelisted phrase (-1): works for me
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: vladbelozertsev