mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-22 21:41:37 +00:00
Add compact JSON5 array formatting plan and update JSON serialization logic
- Introduced a new plan for compacting JSON5 arrays, allowing arrays with fewer than 12 non-compound elements to render inline. - Updated the `write_to()` function in `src/json.rs` to implement this formatting rule, enhancing the output for specific JSON5 structures. - Adjusted test snapshots to reflect the new inline formatting for arrays, ensuring consistency across various JSON5 examples. These changes improve the readability and efficiency of JSON5 data representation, aligning with the new formatting rules.
This commit is contained in:
parent
a17852f963
commit
fe5852f958
4 changed files with 349 additions and 8 deletions
|
|
@ -5,8 +5,6 @@ expression: src/dir_with_meta/init.meta.json5
|
|||
{
|
||||
className: "Configuration",
|
||||
properties: {
|
||||
Tags: [
|
||||
"This tag on dir_with_meta"
|
||||
]
|
||||
Tags: [ "This tag on dir_with_meta" ]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,11 +7,7 @@ expression: src/project_json.project.json5
|
|||
tree: {
|
||||
$className: "Color3Value",
|
||||
$properties: {
|
||||
Value: [
|
||||
1337,
|
||||
-1337,
|
||||
1337
|
||||
]
|
||||
Value: [ 1337, -1337, 1337 ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue