A port of fferegrino/tsp to TypeScript