Change all instances of 'volume' in JSONs to be a metric string II: The Empre Strikes Back #33551
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Infrastructure "Change all instances of 'volume' in JSONs to be a metric string again"
Purpose of change
An update to #33367.
Describe the solution
I've made a proper JSON parser now which can change all types of keys including subkeys.
Changes
'storage', 'contains', 'min_volume', 'max_volume', 'min_pet_volume', 'integral_volume', 'volume'
under the subkeys'use_action', 'workbench', 'container_data', 'armor_data'
to use metric units.Describe alternatives you've considered
Additional context
The change to the comment key in nuts.json:
"//2"
is to prevent duplicate keys being removed when converting from json to javascript object.The change in fragment mass from
2.0
to2
is also due to javascript object conversion. Javascript only has one number type and doesn't distinguish between ints and floats. I assume this doesn't cause any problems.