Data-JavaScript
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
"ExtUtils::MakeMaker" : "0"
}
},
"configure" : {
"requires" : {
"ExtUtils::MakeMaker" : "0"
}
},
"runtime" : {
"requires" : {
"Modern::Perl" : "0",
"Readonly" : "0",
"Scalar::Util" : "0"
}
},
"test" : {
"requires" : {
"B::Debug" : "0",
"Devel::Cover" : "0",
"Devel::Cover::Report::Coveralls" : "0",
"FindBin" : "0",
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: Data-JavaScript
no_index:
directory:
- t
- inc
requires:
Modern::Perl: '0'
Readonly: '0'
Scalar::Util: '0'
resources:
bugtracker: https://github.com/manchicken/data-javascript/issues
repository: https://github.com/manchicken/data-javascript
version: '1.15'
x_contributors:
- 'Jerrad Pierce <jpierce@cpan.org>'
- 'Ariel Brosh <schop cpan.org>'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
Makefile.PL view on Meta::CPAN
$TEST_REQUIRES{'Test2::Tools::PerlCritic'} = '0';
}
WriteMakefile(
NAME => 'Data::JavaScript',
AUTHOR => 'Michael Stemle, Jr. <mstemle@cpan.org>',
VERSION_FROM => 'lib/Data/JavaScript.pm',
ABSTRACT_FROM => 'lib/Data/JavaScript.pm',
LICENSE => 'perl_5',
PREREQ_PM =>
{ 'Modern::Perl' => '0', 'Readonly' => '0', 'Scalar::Util' => '0' },
TEST_REQUIRES => \%TEST_REQUIRES,
META_MERGE => {
'meta-spec' => { version => 2 },
'x_contributors' =>
[ 'Jerrad Pierce <jpierce@cpan.org>', 'Ariel Brosh <schop cpan.org>', ],
resources => {
bugtracker =>
{ web => 'https://github.com/manchicken/data-javascript/issues', },
repository => {
type => 'git',
lib/Data/JavaScript.pm view on Meta::CPAN
package Data::JavaScript; ## no critic (PodSpelling)
use Modern::Perl;
use Readonly;
use Scalar::Util 'reftype';
our $VERSION = q/1.15/;
# Exporter
Readonly our @EXPORT => qw(jsdump hjsdump);
Readonly our @EXPORT_OK => '__quotemeta';
Readonly our %EXPORT_TAGS => (
all => [ @EXPORT, @EXPORT_OK ],
t/0-critic.t view on Meta::CPAN
#!/usr/bin/env perl
use Modern::Perl;
use Test2::V0;
use Test2::Require::Perl 'v5.20';
use Test2::Require::EnvVar 'RELEASE_TESTING';
use Test2::Tools::PerlCritic;
perl_critic_ok 'lib', 'test library files';
perl_critic_ok 't', 'test test files';
#!/usr/bin/env perl
use Modern::Perl;
use Test2::V0;
use Data::JavaScript;
ok length $Data::JavaScript::VERSION > 0, 'Module loads';
done_testing;
t/2-import.t view on Meta::CPAN
#!/usr/bin/env perl
use Modern::Perl;
use Test2::V0;
use Test2::Tools::Subtest qw/subtest_buffered/;
use Data::JavaScript qw(:all);
subtest_buffered private_quotemeta => sub {
# We're verifying that a newline is quoted.
is
__quotemeta( "Hello World\n" ),
#!/usr/bin/env perl
use Modern::Perl;
use Test2::V0;
#No Unicode, undef yields empty strings
use Data::JavaScript ( ':compat' => { JS => 1.2 } );
#Test undef default
is join( q//, jsdump( 'foo', [ 1, undef, 1 ] ) ),
q/var foo = new Array;foo[0] = 1;foo[1] = '';foo[2] = 1;/,
'Default undefined value';
t/3-noArgs.t view on Meta::CPAN
#!/usr/bin/env perl
use Modern::Perl;
use Test2::V0;
use Test2::Require::Perl 'v5.7';
use Data::JavaScript;
#Test undef default
is join( q//, jsdump( 'foo', [ 1, undef, 1 ] ) ),
'var foo = new Array;foo[0] = 1;foo[1] = undefined;foo[2] = 1;',
'Default undef';
t/3-undef.t view on Meta::CPAN
#!/usr/bin/env perl
use Modern::Perl;
use Test2::V0;
use Data::JavaScript ( ':all' => { UNDEF => 0 } );
#Test undef value overloading
is join( q//, jsdump( 'foo', [ 1, undef, 1 ] ) ),
'var foo = new Array;foo[0] = 1;foo[1] = undefined;foo[2] = 1;',
'Literal undefined.';
t/4-escape.t view on Meta::CPAN
#!/usr/bin/env perl
use Modern::Perl;
use Test2::V0;
use Data::JavaScript;
use Readonly;
Readonly my $NEGATIVE_ONE => -1;
Readonly my $PI => 3.14159;
#Test numbers: negative, real, engineering, octal/zipcode
t/5-multi-line.t view on Meta::CPAN
#!/usr/bin/env perl
use Modern::Perl;
use Test2::V0;
use Test2::Tools::Subtest qw/subtest_buffered/;
use Data::JavaScript qw(:all);
my $input = <<'EOF',
This is a multi-line entry.
See? I have two lines.
Now there are three lines!
t/6-accents.t view on Meta::CPAN
#!/usr/bin/env perl
use Modern::Perl;
use utf8;
use Test2::V0;
use Test2::Tools::Subtest qw/subtest_buffered/;
use Data::JavaScript qw(:all);
#<<<
my $input = q/«Hêllö» Thére!/;
my $expected = qq/var output = "\\u00ABH\\u00EAll\\u00F6\\u00BB Th\\u00E9re!";\n/;
t/7-nested-compat.t view on Meta::CPAN
#!/usr/bin/env perl
use Modern::Perl;
use Test2::V0;
use Data::JavaScript qw(:all);
my $input = {
a => {
a1 => [qw/a1i a1ii a1iii/]
},
b => {
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.601 second using v1.00-cache-2.02-grep-82fe00e-cpan-48ebf85a1963 )