Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bun.inspect() has strange formatting when showing a Set inside an object #16007

Open
laesse opened this issue Dec 27, 2024 · 0 comments · May be fixed by #16013
Open

Bun.inspect() has strange formatting when showing a Set inside an object #16007

laesse opened this issue Dec 27, 2024 · 0 comments · May be fixed by #16013
Labels
bug Something isn't working needs triage

Comments

@laesse
Copy link

laesse commented Dec 27, 2024

What version of Bun is running?

1.1.42+50eec0025

What platform is your computer?

Darwin 23.6.0 arm64 arm

What steps can reproduce the bug?

The following code produces strange formatting if a set is nested inside an object

const map = new Map([
  ["foo", "bar"],
  ["baz", "qux"],
]); // for comparison
const set = new Set(["foo", "bar"]);
const bug = Bun.inspect({ map, set, foo: { bar: { set } } });
console.log(bug);

What is the expected behavior?

Expected output looks like for map.

❯ bun min.ts
{
  map: Map(2) {
    "foo": "bar",
    "baz": "qux",
  },
  set:   Set(2) {
    "foo",
    "bar",
},
  foo: {
    bar: {
      set:       Set(2) {
        "foo",
        "bar",
},
    },
  },
}

What do you see instead?

2 extra spaces between the field name and Set for each nesting layer of the object.
also the closing } is not indented.

Additional information

No response

@laesse laesse added bug Something isn't working needs triage labels Dec 27, 2024
@laesse laesse linked a pull request Dec 27, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant