( ops: T, tracer: FuseTracer, )
| 185 | * functions short-circuit, so wrapping twice is a no-op. |
| 186 | */ |
| 187 | export function wrapFuseOpsWithTracer<T extends Record<string, unknown>>( |
| 188 | ops: T, |
| 189 | tracer: FuseTracer, |
| 190 | ): T { |
| 191 | const out: Record<string, unknown> = {}; |
| 192 | for (const [name, value] of Object.entries(ops)) { |
| 193 | if (typeof value === "function") { |
| 194 | out[name] = tracer.wrap(name, value as never); |
| 195 | } else { |
| 196 | out[name] = value; |
| 197 | } |
| 198 | } |
| 199 | return out as T; |
| 200 | } |
no test coverage detected