Odin icon indicating copy to clipboard operation
Odin copied to clipboard

add pretty json output in marshal based on spec + options

Open Skytrias opened this issue 3 years ago • 0 comments

adds Marshal_Options to customize the marshal output

can switch between tabs / spaces with use_spaces & spaces >= 1 mjson options for not using quotes & using = instead of : option to output uint as hex numbers

example using .MJSON

json.marshal(
	value, 
	{
		spec = .MJSON,
		pretty = true,
		write_uint_as_hex = true,
		mjson_keys_use_equal_sign = true,
	},
)

example using empty options

json.marshal(value, {})

Skytrias avatar Aug 08 '22 16:08 Skytrias