Skip to content

Commit

Permalink
Detect class values in inspect()
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Nov 6, 2023
1 parent 3da8f5e commit 4cc683e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/tidy-dryers-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'nxjs-runtime': patch
---

Detect `class` values in `inspect()`
3 changes: 3 additions & 0 deletions packages/runtime/src/inspect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ export const inspect = (v: unknown, opts?: InspectOptions): string => {

if (typeof v === 'function') {
const { name } = v;
if (String(v).startsWith('class')) {
return cyan(`[class${name ? `: ${name}` : ''}]`);
}
return cyan(`[Function${name ? `: ${name}` : ' (anonymous)'}]`);
}
if (Array.isArray(v)) {
Expand Down

0 comments on commit 4cc683e

Please sign in to comment.