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

Beautify removing some keys from objects in array #413

Open
pecampelo opened this issue Oct 20, 2022 · 0 comments
Open

Beautify removing some keys from objects in array #413

pecampelo opened this issue Oct 20, 2022 · 0 comments

Comments

@pecampelo
Copy link

pecampelo commented Oct 20, 2022

  • Windows 10 (x64)
  • VS Code 1.72.2
  • local beautify

I do not make use of any .editorconfig or jsbeautifyrc files nor language-specific settings.

Action performed

I tried to beautify a JSON file with 2 spaces and keep command:

It was supposed to look like this, which I was able to do using Prettify instead:

[
  {
    "movie": "Ghostbusters",
    "status": "deleted",
    "inserted_at": "2022-10-04T20:38:00",
    "timestamp": "2021-11-10T03:00:00Z",
    "updated_at": "2022-10-18T20:04:00",
    "deleted_at": "2022-10-18T20:05:00",
  },
  {
    "movie": "Ghostbusters 2",
    "status": "active",
    "inserted_at": "2022-10-04T23:38:00",
    "timestamp": "2021-11-10T04:00:00Z",
    "updated_at": "2022-10-18T21:03:00",
    "deleted_at": null,
  }
]

Using Beautify:

[
  {
    "movie": "Ghostbusters",
    "inserted_at": "2022-10-04T20:38:00",
    "timestamp": "2021-11-10T03:00:00Z",
  },
  {
    "movie": "Ghostbusters 2",
    "inserted_at": "2022-10-04T23:38:00",
    "timestamp": "2021-11-10T04:00:00Z",
    "updated_at": "2022-10-18T21:03:00"
  }
]

Basically, it removed some keys from the .json file. Specifically, the status and deleted_at fields.
Maybe it has something to do with the fields being a standard for the package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant