X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FStorage%2FFormat%2FJSON.pm;h=d926bcf9514c18eb283a0e821b7d7ddb5fc56a01;hb=d3671a48f9673b8f5e74f9105b56406e4bfe5a6b;hp=bc8316c24b537291b734714d6732bc5a3a9a2d95;hpb=e44b5f5498b782752d2c91b6796698c86143a2f0;p=gitmo%2FMooseX-Storage.git diff --git a/lib/MooseX/Storage/Format/JSON.pm b/lib/MooseX/Storage/Format/JSON.pm index bc8316c..d926bcf 100644 --- a/lib/MooseX/Storage/Format/JSON.pm +++ b/lib/MooseX/Storage/Format/JSON.pm @@ -1,4 +1,3 @@ - package MooseX::Storage::Format::JSON; use Moose::Role; @@ -7,9 +6,6 @@ no warnings 'once'; use JSON::Any; use utf8 (); -our $VERSION = '0.32'; -our $AUTHORITY = 'cpan:STEVAN'; - requires 'pack'; requires 'unpack'; @@ -21,7 +17,7 @@ sub thaw { sub freeze { my ( $self, @args ) = @_; - my $json = JSON::Any->new->objToJson( $self->pack(@args) ); + my $json = JSON::Any->new(canonical => 1)->objToJson( $self->pack(@args) ); utf8::decode($json) if !utf8::is_utf8($json) and utf8::valid($json); # if it's valid utf8 mark it as such return $json; }