Context
Follow-up from review of #55. As noted there:
The Hellog class is getting a bit bigger than what I'd like it to be [...] I'd like to move the timers and metas into isolated classes handling their logic and serde layers
The Hellog class now owns timer state (_timers map, time/timeEnd) and meta resolution/merging (_resolveMeta, child/log merge logic) inline. These should be extracted into dedicated classes that own their logic and serialization.
Proposed shape
lib/timer.ts → HellogTimer: owns the Map<string, bigint> timer store, start(label), end(label): number | undefined (elapsed ms, one-shot), and a static format(label, ms) for the duration serialization.
lib/meta.ts → HellogMeta: owns meta resolution and parent/child merging — resolve(), merge(extra), child(extra) — replacing Hellog._resolveMeta and the inline merge logic in child/_log.
Hellog delegates to both; public behavior (child meta merging, timer durations) unchanged.
- Export both from
lib/index.ts; add lib/timer.spec.ts and lib/meta.spec.ts.
Behavior must remain identical to today.
Context
Follow-up from review of #55. As noted there:
The
Hellogclass now owns timer state (_timersmap,time/timeEnd) and meta resolution/merging (_resolveMeta, child/log merge logic) inline. These should be extracted into dedicated classes that own their logic and serialization.Proposed shape
lib/timer.ts→HellogTimer: owns theMap<string, bigint>timer store,start(label),end(label): number | undefined(elapsed ms, one-shot), and a staticformat(label, ms)for the duration serialization.lib/meta.ts→HellogMeta: owns meta resolution and parent/child merging —resolve(),merge(extra),child(extra)— replacingHellog._resolveMetaand the inline merge logic inchild/_log.Hellogdelegates to both; public behavior (child meta merging, timer durations) unchanged.lib/index.ts; addlib/timer.spec.tsandlib/meta.spec.ts.Behavior must remain identical to today.