79272455

Date: 2024-12-11 16:25:03
Score: 0.5
Natty:
Report link

Not ideal, but one option is to reconstruct an object with the checked type:

function typecheck<T extends Language>(code: Code<T>) {
    const { lang, content } = code;
    if (lang === "TYPESCRIPT") {
        typecheckTS({ lang, content });
    } else {
        // ...
    }
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Wyrzutek