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

array of object doesn't observe condense mode #33

Open
nyurik opened this issue Dec 28, 2017 · 1 comment
Open

array of object doesn't observe condense mode #33

nyurik opened this issue Dec 28, 2017 · 1 comment

Comments

@nyurik
Copy link

nyurik commented Dec 28, 2017

Hi, once again, awesome project! This is a "nice to have", but it would optimize the output a lot. The condense mode fails for this case:

{
  transform: [
    {type: "geoshape", projection: "projection"}
  ]
  ...
}

with these options: condense: 100, bracesSameLine: true, keepWsc: true

Expected result (assuming this is not the only key)

{
  transform: [{type: "geoshape", projection: "projection"}]
  ...
}

If this was the whole document, it probably should have even been this:

{transform: [{type: "geoshape", projection: "projection"}]}
@laktak
Copy link
Member

laktak commented Jan 2, 2018

The current implementation of stringify inserts the whitespace directly (the code is already a bit too complex). To support what you want would IMO require a rewrite to make it a two step process. If you (or someone else) is interested in doing a PR we could discuss this further.

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

2 participants