e
# bundled with this file.
#
=head1 NAME
FP::JSON
=head1 SYNOPSIS
use FP::JSON qw(to_json);
my $settings = {
output_format => "JSON", # or "Mint"
auto_numbers => 1,
},
# pretty => 1, # extra re-parsing step at the end
};
use FP::List;
is to_json([10, list(20,30), {40=> "foo", bar=> 50}], $settings),
'[
10,
[
20,
30
" : 50
}
]
';
=head1 DESCRIPTION
Currently just provides `to_json` to turn some kinds of data into a
JSON or Mint language string. This module will need some work for more
serious use
b quote_javascript {
@_ == 1 or fp_croak_arity 1;
my ($str) = @_;
#require JSON::MaybeXS;
#JSON->new->allow_nonref(1)->encode($str)
# this doesn't turn special characters into ba
just use
# JSON::PP directly and suck up the terrible performance
require JSON::PP;
JSON::PP->new->allow_nonref(1)->encode($str)
# <mst> note that JSON::MaybeXS is trivial
020", "List::BinarySearch"],
'FP::RegexMatch' => ["5.020"],
'FP::JSON' => ['JSON', "5.020"],
'FP::Abstract::Sequence::t' => ['FP::autobox'],
'Chj::Serialize