In util.civet, there's this:
/**
handler to source
*/
hToS := (h: Handler | undefined): string ->
return "" unless h?
if typeof h is "object" and "f" in h // functional handler
// Function handler type annotation
t := "t" in h ? ` :: ${h.t.trim()}` : ""
// Restore indentation
`${t} ->\n${h.f.replace(/^|\n/g, "$& ")}`
else // structural handler
" -> " + structuralToSource(h)
The problem is in the assignment to variable t. You're checking that t is a key in h, but that doesn't guarantee that h.t is defined. In fact, I'd check for (typeof h.t == 'string') to be sure it's not only defined, but is a string. I'm not sure why whatever version of TypeScript you developed this under didn't catch that, but it's a simple fix.
In
util.civet, there's this:The problem is in the assignment to variable t. You're checking that t is a key in h, but that doesn't guarantee that h.t is defined. In fact, I'd check for (typeof h.t == 'string') to be sure it's not only defined, but is a string. I'm not sure why whatever version of TypeScript you developed this under didn't catch that, but it's a simple fix.