Skip to content

Commit

Permalink
Std: trace for single variant types
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanjermakov committed Mar 19, 2024
1 parent 98e8800 commit 9e2706d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/std/io/trace.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ function trace_(a) {
return `[${a.value.map(trace_).join(', ')}]`
}

return `${a.$noisVariant}(${[...Object.entries(a.value)]
const variant = a.$noisVariant ?? a.$noisType.slice(a.$noisType.lastIndexOf('::') + 2)
return `${variant}(${[...Object.entries(a.value)]
.map(([name, value]) => `${name}: ${trace_(value)}`)
.join(', ')})`
}

0 comments on commit 9e2706d

Please sign in to comment.