From 6cc323dc15b8da9e5d0faaacc677272c713ac559 Mon Sep 17 00:00:00 2001 From: xingchen <1098756313@qq.com> Date: Fri, 25 Sep 2026 11:57:04 +0800 Subject: [PATCH] feat: add main.mjs --- main.mjs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 main.mjs diff --git a/main.mjs b/main.mjs new file mode 100644 index 0000000..0f4e140 --- /dev/null +++ b/main.mjs @@ -0,0 +1,10 @@ +import { correlate } from './src/correlate.mjs'; +import { summarize } from './src/report.mjs'; + +const events = [ + { device: 'RIG-1', alarmId: 'TEMP', type: 'ACK', time: 20 }, + { device: 'RIG-1', alarmId: 'TEMP', type: 'ALARM', time: 10 }, + { device: 'RIG-1', alarmId: 'TEMP', type: 'CLEAR', time: 30 }, + { device: 'RIG-2', alarmId: 'VOLT', type: 'ALARM', time: 40 }, +]; +console.log(JSON.stringify(summarize(correlate(events)), null, 2));