package Aion::Format::Json;
use common::sense;
use JSON::XS qw//;
use Exporter qw/import/;
our @EXPORT = our @EXPORT_OK = grep {
*{$Aion::Format::Json::{$_}}{CODE} && !/^(_|(NaN|import)\z)/n
} k
ory json
# Настраиваем json
our $JSON = JSON::XS->new->allow_nonref->indent(1)->space_after(1)->canonical(1);
# В json
sub to_json(;$) {
$JSON->encode(@_ == 0? $_: @_)
}
# Из json
su
_json(;$) {
$JSON->decode(@_ == 0? $_: @_)
}
1;
__END__
=encoding utf-8
=head1 NAME
Aion::Format::Json - Perl extension for formatting JSON
=head1 SYNOPSIS
use Aion::Format::Json;
to_json