Aion-Format
view release on metacpan or search on metacpan
},
"runtime" : {
"recommends" : {
"Devel::Size" : "0"
},
"requires" : {
"DDP" : "0",
"Encode" : "0",
"Exporter" : "0",
"Guard" : "0",
"JSON::XS" : "0",
"List::Util" : "0",
"POSIX" : "0",
"Term::ANSIColor" : "0",
"YAML::Syck" : "0",
"bigint" : "0",
"bytes" : "0",
"common::sense" : "0",
"config" : "0",
"constant" : "0",
"perl" : "v5.22.0"
file: lib/Aion/Format/Url.pm
Aion::Format::Yaml:
file: lib/Aion/Format/Yaml.pm
recommends:
Devel::Size: '0'
requires:
DDP: '0'
Encode: '0'
Exporter: '0'
Guard: '0'
JSON::XS: '0'
List::Util: '0'
POSIX: '0'
Term::ANSIColor: '0'
YAML::Syck: '0'
bigint: '0'
bytes: '0'
common::sense: '0'
config: '0'
constant: '0'
perl: v5.22.0
requires 'open';
};
# ÐÐ»Ñ DDP
recommends 'Devel::Size';
requires 'DDP';
requires 'Guard';
requires 'Encode';
requires 'Exporter';
requires 'JSON::XS';
requires 'List::Util';
requires 'POSIX';
requires 'Term::ANSIColor';
requires 'YAML::Syck';
requires 'bigint';
requires 'bytes';
requires 'common::sense';
requires 'config';
requires 'constant';
i18n/Aion/Format/Json.ru-en.po view on Meta::CPAN
msgid "Aion::Format::Json - ÑаÑÑиÑение Perl Ð´Ð»Ñ ÑоÑмаÑиÑÐ¾Ð²Ð°Ð½Ð¸Ñ JSON"
msgstr "Aion::Format::Json - Perl extension for JSON formatting"
msgid "`Aion::Format::Json` иÑполÑзÑÐµÑ Ð² каÑеÑÑве оÑÐ½Ð¾Ð²Ñ `JSON::XS`. РвклÑÑÐ°ÐµÑ ÑледÑÑÑие наÑÑÑойки:"
msgstr "`Aion::Format::Json` uses `JSON::XS` as a base. And includes the following settings:"
msgid ""
"* allow_nonref â ÑкалÑÑÑ ÐºÐ¾Ð´Ð¸ÑÐ¾Ð²Ð°Ð½Ð¸Ñ Ð¸ декодиÑованиÑ.\n"
"* indent â вклÑÑиÑÑ Ð¼Ð½Ð¾Ð³Ð¾ÑÑÑоÑнÑй ÑекÑÑ Ñ Ð¾ÑÑÑÑпом в наÑале ÑÑÑоки.\n"
"* space_after â `\\n` поÑле json.\n"
"* canonical â ÑоÑÑиÑовка клÑÑей в Ñ
еÑаÑ
."
msgstr ""
"* allow_nonref - encoding and decoding scalars.\n"
"* indent â enable multiline text with indentation at the beginning of the line.\n"
"* space_after â `\\n` after json.\n"
lib/Aion/Format/Json.md view on Meta::CPAN
```perl
use Aion::Format::Json;
to_json {a => 10} # => {\n "a": 10\n}\n
from_json '[1, "5"]' # --> [1, "5"]
```
# DESCRIPTION
`Aion::Format::Json` иÑполÑзÑÐµÑ Ð² каÑеÑÑве оÑÐ½Ð¾Ð²Ñ `JSON::XS`. РвклÑÑÐ°ÐµÑ ÑледÑÑÑие наÑÑÑойки:
* allow_nonref â ÑкалÑÑÑ ÐºÐ¾Ð´Ð¸ÑÐ¾Ð²Ð°Ð½Ð¸Ñ Ð¸ декодиÑованиÑ.
* indent â вклÑÑиÑÑ Ð¼Ð½Ð¾Ð³Ð¾ÑÑÑоÑнÑй ÑекÑÑ Ñ Ð¾ÑÑÑÑпом в наÑале ÑÑÑоки.
* space_after â `\n` поÑле json.
* canonical â ÑоÑÑиÑовка клÑÑей в Ñ
еÑаÑ
.
# SUBROUTINES
## to_json (;$data)
lib/Aion/Format/Json.pm view on Meta::CPAN
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
} keys %Aion::Format::Json::;
#@category json
# ÐаÑÑÑаиваем json
our $JSON = JSON::XS->new->allow_nonref->indent(1)->space_after(1)->canonical(1);
# Ð json
sub to_json(;$) {
$JSON->encode(@_ == 0? $_: @_)
}
# Ðз json
sub from_json(;$) {
$JSON->decode(@_ == 0? $_: @_)
}
lib/Aion/Format/Json.pm view on Meta::CPAN
=head1 SYNOPSIS
use Aion::Format::Json;
to_json {a => 10} # => {\n "a": 10\n}\n
from_json '[1, "5"]' # --> [1, "5"]
=head1 DESCRIPTION
C<Aion::Format::Json> uses C<JSON::XS> as a base. And includes the following settings:
=over
=item * allow_nonref - encoding and decoding scalars.
=item * indent â enable multiline text with indentation at the beginning of the line.
=item * space_after â C<\n> after json.
=item * canonical - sorting keys in hashes.
t/aion/format/json.t view on Meta::CPAN
#
subtest 'SYNOPSIS' => sub {
use Aion::Format::Json;
local ($::_g0 = do {to_json {a => 10}}, $::_e0 = "{\n \"a\": 10\n}\n"); ::ok $::_g0 eq $::_e0, 'to_json {a => 10} # => {\n "a": 10\n}\n' or ::diag ::_string_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {from_json '[1, "5"]'}, $::_e0 = do {[1, "5"]}); ::is_deeply $::_g0, $::_e0, 'from_json \'[1, "5"]\' # --> [1, "5"]' or ::diag ::_struct_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
#
# # DESCRIPTION
#
# `Aion::Format::Json` иÑполÑзÑÐµÑ Ð² каÑеÑÑве оÑÐ½Ð¾Ð²Ñ `JSON::XS`. РвклÑÑÐ°ÐµÑ ÑледÑÑÑие наÑÑÑойки:
#
# * allow_nonref â ÑкалÑÑÑ ÐºÐ¾Ð´Ð¸ÑÐ¾Ð²Ð°Ð½Ð¸Ñ Ð¸ декодиÑованиÑ.
# * indent â вклÑÑиÑÑ Ð¼Ð½Ð¾Ð³Ð¾ÑÑÑоÑнÑй ÑекÑÑ Ñ Ð¾ÑÑÑÑпом в наÑале ÑÑÑоки.
# * space_after â `\n` поÑле json.
# * canonical â ÑоÑÑиÑовка клÑÑей в Ñ
еÑаÑ
.
#
# # SUBROUTINES
#
# ## to_json (;$data)
#
( run in 1.458 second using v1.01-cache-2.11-cpan-39bf76dae61 )