Skip to content

Beautify removing some keys from objects in array #413

@pecampelo

Description

@pecampelo
  • 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions