From d54e91c6582ed160cf2f2fcf977e48b4439d133b Mon Sep 17 00:00:00 2001 From: Elizabeth Alexander Hunt Date: Sun, 18 May 2025 22:54:15 -0700 Subject: snapshot --- u/trace/util.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'u/trace/util.ts') diff --git a/u/trace/util.ts b/u/trace/util.ts index dd8fb0d..302c8e4 100644 --- a/u/trace/util.ts +++ b/u/trace/util.ts @@ -7,6 +7,16 @@ import type { } from "@emprespresso/pengueno"; export class TraceUtil { + static withTrace( + trace: string, + ): ITraceableMapper< + T, + ITraceableTuple>, + Trace + > { + return (t) => [t.get(), `[${trace}]`]; + } + static withMetricTrace( metric: IMetric, ): ITraceableMapper< @@ -24,7 +34,7 @@ export class TraceUtil { ITraceableTuple>, Trace > { - return (t) => [t.get(), `[${f.name}]`]; + return TraceUtil.withTrace(f.name); } static withClassTrace( @@ -34,7 +44,7 @@ export class TraceUtil { ITraceableTuple>, Trace > { - return (t) => [t.get(), `[${c.constructor.name}]`]; + return TraceUtil.withTrace(c.constructor.name); } static promiseify( -- cgit v1.2.3-70-g09d2