79752026

Date: 2025-08-31 21:34:22
Score: 1.5
Natty:
Report link

What about just this,

function getItems<T extends "circle" | "square">(type: T) {
    return shapes.filter(s => s.type == type) as ((Circle | Square) & {type: T})[];
}
Reasons:
  • Low length (1):
  • Has code block (-0.5):
  • Starts with a question (0.5): What
  • Low reputation (0.5):
Posted by: Sean