DATE
our $VERSION = '0.03'; # VERSION
use 5.010001;
use strict;
use warnings;
use JSON::MaybeXS;
my $json = JSON::MaybeXS->new->allow_nonref;
use Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK
2";
}
} else {
return $json->encode("$str");
}
}
sub decode_js_string {
my $str = shift;
if ($str =~ /\A"/o) {
$json->decode($str);
} elsif ($str =~ /\A'/o
JavaScript literal representation using double
quotes (C<">). This is currently implemented using JSON encoding.
If C<$mode> is set to 1, will produce literal representation using single quotes
(C<'>