TypeScript is good for some things. If you like named arguments in functions (functions that take objects), it gets rough, though. Here is what it looks like when you make one of those, and you want default values.
export function getNByNGraph(
{ points, startProp, destProp, distProp }:
{ points: IdPt[]; startProp: string; destProp: string; distProp: string } =
{ points: [], startProp: 'from', destProp: 'to', distProp: 'weight' }
): IdPt[] {
It's like a little essay preamble of its own.