Javascipt / Jsome

:sparkles: Make your JSON look AWESOME
MIT License
244 stars 24 forks source link

Display long array one item per line #16

Closed antonmedv closed 5 years ago

antonmedv commented 6 years ago

For long arrays:

Bad:

["jetradar_mobile_search", "credit_deeplink_preparation", "credit_deeplink", "airline_deeplink", "mobile_search_native_format", "search", "special_offer_click_builder", "travelpayouts_api_authenticator", "kiwi_assisted_confirm", "pixel_booking", "jetradar_mobile_rt_search_native_format", "jetradar_mobile_search_native_format", "tickets_assisted_deeplink", "stub_chain", "amadeus_chain", "mobile_rt_search", "jetradar_rt_search_native_format", "tickets_assisted_booking", "deeplink", "mobile_rt_search_native_format", "ndc_deeplink", "mobile_search", "special_offer", "ndc_booking", "kiwi_assisted_deeplink", "rt_search_native_format", "non_persisted_deeplink", "travelpayouts_api_request_signer", "kiwi_assisted_booking", "ndc_retrieve", "jetradar_mobile_rt_search"]

Better:

[
  "jetradar_mobile_search",
  "credit_deeplink_preparation",
  "credit_deeplink",
  "airline_deeplink",
  "mobile_search_native_format",
  "search",
  "special_offer_click_builder",
  "travelpayouts_api_authenticator",
  "kiwi_assisted_confirm",
  "pixel_booking",
  "jetradar_mobile_rt_search_native_format",
  "jetradar_mobile_search_native_format",
  "tickets_assisted_deeplink",
  "stub_chain",
  "amadeus_chain",
  "mobile_rt_search",
  "jetradar_rt_search_native_format",
  "tickets_assisted_booking",
  "deeplink",
  "mobile_rt_search_native_format",
  "ndc_deeplink",
  "mobile_search",
  "special_offer",
  "ndc_booking",
  "kiwi_assisted_deeplink",
  "rt_search_native_format",
  "non_persisted_deeplink",
  "travelpayouts_api_request_signer",
  "kiwi_assisted_booking",
  "ndc_retrieve",
  "jetradar_mobile_rt_search"
]
colxi commented 5 years ago

It would be nice to control the behaviour with a configurable param. I can imagine scenarios where would be useful to have a compact output, and scenarios where the expanded one would be more appropriate.