JSON-PP icon indicating copy to clipboard operation
JSON-PP copied to clipboard

space_after doesn't add space after comma

Open haukex opened this issue 1 year ago • 0 comments

The documentation of the space_after option says that it "will add ... extra whitespace after the , separating key-value pairs and array members." However, it doesn't actually do this.

use warnings;
use strict;
use Cpanel::JSON::XS ();
use JSON::PP ();

print Cpanel::JSON::XS->new->utf8->space_after->encode({x=>[1,2]}), "\n";
print         JSON::PP->new->utf8->space_after->encode({x=>[1,2]}), "\n";

__END__

{"x": [1, 2]}
{"x": [1,2]}

haukex avatar Apr 13 '24 16:04 haukex