1import type { Snapshot, Config } from "./types"; 2 3// pure: same snapshot in → same config out 4export function buildConfig(snapshot: Snapshot): Config { 5 const sensors = snapshot.sensors.map(toSensor); 6 const slots = allocate(snapshot.ports, sensors); 7 const config = { version: 2, sensors, slots }; 8 return config; 9}
4buildConfig( snapshot: Snapshot )
7const config = {…}; 8return config; 9}