parseRoute

atlas.parseRoute · #22hq7cjw · term · runs anywhere

Read a route from the command line (0,0 3,4 3,0).

import type { Point } from "#codebase/geo";

export const parseRoute = (args: string[]): Point[] =>
  args.map((a) => {
    const [x, y] = a.split(",").map(Number);
    return { x: x!, y: y! };
  })

uses

used by