import type {Data, Worker} from './types'; interface Image { step: number; wallTime: number; } const worker: Worker = async io => { const components = await io.getData('/components'); if (!components.includes('image')) { return; } const {runs, tags} = await io.save('/image/tags'); for (const [index, run] of runs.entries()) { for (const tag of tags[index]) { const list = (await io.save('/image/list', {run, tag})) ?? []; for (const [index, image] of list.entries()) { await io.saveBinary('/image/image', {run, tag, index, ts: image.wallTime}); } } } }; export default worker;