Group
Extension

Matches 35358

JSON-Color ( P/PE/PERLANCAR/JSON-Color-0.134.tar.gz, PERLANCAR, 2023; MetaCPAN )
JSON-Color/lib/JSON/Color.pm ( view source; MetaCPAN )
package JSON::Color;

use 5.010001;
use strict;
use warnings;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2023-07-02'; # DATE
our $DIST = 'JSON-Color'; # DIST
our $VERSION = '0.134'; 
keNumber; 1 } ? 1:0;

require Exporter;
our @ISA       = qw(Exporter);
our @EXPORT_OK = qw(encode_json);

use Color::ANSI::Util qw(ansi_reset);
use ColorThemeRole::ANSI (); # for scan_prereqs

my %esc
elsif ($ref eq 'HASH') {
        return _hash($data, $opts);
    } elsif ($ref eq 'JSON::XS::Boolean' || $ref eq 'JSON::PP::Boolean') {
        return _bool($data, $opts);
    } elsif (!$ref) {
      
JSON-Color ( P/PE/PERLANCAR/JSON-Color-0.134.tar.gz, PERLANCAR, 2023; MetaCPAN )
JSON-Color/lib/ColorTheme/JSON/Color/bright256.pm ( view source; MetaCPAN )
eme::JSON::Color::bright256;

use strict;
use parent 'ColorThemeBase::Static::FromStructColors';

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2023-07-02'; # DATE
our $DIST = 'JSON-Colo
:JSON::Color::bright256 - A brighter color theme for 256-color terminal, adapted from the Data::Dump::Color::Default256 theme

=head1 VERSION

This document describes version 0.134 of ColorTheme::JSON
::bright256 (from Perl distribution JSON-Color), released on 2023-07-02.

=head1 HOMEPAGE

Please visit the project's homepage at L<https://metacpan.org/release/JSON-Color>.

=head1 SOURCE

Source rep
Error-Pure-Output-JSON ( S/SK/SKIM/Error-Pure-Output-JSON-0.11.tar.gz, SKIM, 2023; MetaCPAN )
Error-Pure-Output-JSON/lib/Error/Pure/Output/JSON.pm ( view source; MetaCPAN )
package Error::Pure::Output::JSON;

use base qw(Exporter);
use strict;
use warnings;

use JSON;
use Readonly;

# Constants.
Readonly::Array our @EXPORT_OK => qw(err_json);

# Global variables.
our $PR
11;

# JSON print of backtrace.
sub err_json {
	my @errors = @_;
	my $ret_json;
	my $json = JSON->new;
	if ($PRETTY) {
		$ret_json = $json->pretty->encode(@errors);
	} else {
		$ret_json = $json->enco
n $ret_json;
}

1;

__END__

=pod

=encoding utf8

=head1 NAME

Error::Pure::Output::JSON - Output JSON subroutines for Error::Pure.

=head1 SYNOPSIS

 use Error::Pure::Output::JSON qw(err_json);
 pri
MooX-Tag-TO_HASH ( D/DJ/DJERIUS/MooX-Tag-TO_HASH-0.05.tar.gz, DJERIUS, 2023; MetaCPAN )
MooX-Tag-TO_HASH/lib/MooX/Tag/TO_JSON.pm ( view source; MetaCPAN )
MooX::Tag::TO_JSON;

# ABSTRACT: Controlled translation of Moo objects into JSON appropriate Hashes

use v5.10;

use strict;
use warnings;

our $VERSION = '0.05';

use Safe::Isa;
use JSON::MaybeXS ();
 => LC_TO_JSON,
  -handler => sub { make_tag_handler( LC_TO_JSON ) };

use namespace::clean -except => [ '_tags', '_tag_list' ];









sub TO_JSON {
    my $self = shift;

    my $to_json = $self->
sh->{ +LC_TO_JSON } // {};

    # the structure of %to_json is complicated because has() may take
    # multiple attributes.  For example,

    # has ['foo','bar'] => ( is => 'ro', to_json => '1' );

Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Sah/SchemaR/any_from_json.pm ( view source; MetaCPAN )
## no critic: TestingAndDebugging::RequireStrict
package Sah::SchemaR::any_from_json;

our $DATE = '2022-11-15'; # DATE
our $VERSION = '0.007'; # VERSION

our $rschema = do{my$var={base=>"any",clsets_
l be assumed to be a\nJSON-encoded value and decoded. Data will not be valid if the string does not\ncontain valid JSON.\n\nThus, if you want to supply a string, you have to JSON-encode it.\n\n",examp
a valid JSON",valid=>0,value=>""},{summary=>"A number",valid=>1,value=>1},{valid=>1,validated_value=>undef,value=>"null"},{summary=>"Not a valid JSON literal, you have to encode string in JSON",valid=
Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Sah/Schemas/JSON.pm ( view source; MetaCPAN )
g::RequireUseStrict
package Sah::Schemas::JSON;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-11-15'; # DATE
our $DIST = 'Sah-Schemas-JSON'; # DIST
our $VERSION = '0.007'; # VERSIO
elated to JSON

__END__

=pod

=encoding UTF-8

=head1 NAME

Sah::Schemas::JSON - Various schemas related to JSON

=head1 VERSION

This document describes version 0.007 of Sah::Schemas::JSON (from Per
tion Sah-Schemas-JSON), released on 2022-11-15.

=head1 SAH SCHEMAS

The following schemas are included in this distribution:

=over

=item * L<any_from_json|Sah::Schema::any_from_json>

A data struct
Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Sah/SchemaR/json_str/array.pm ( view source; MetaCPAN )
maR::json_str::array;

our $DATE = '2022-11-15'; # DATE
our $VERSION = '0.007'; # VERSION

our $rschema = do{my$var={base=>"str",clsets_after_base=>[{description=>"\nThis schema is like the `json_str`
d JSON. The JSON string will not be decoded but you know that the string\ncontains a valid JSON. In addition to that, the JSON must encode an array. Data\nwill not be valid if it is not a valid JSON o
r if the JSON is not an array.\n\nNote that unlike the `array_from_json` schema, an array data is not accepted by\nthis schema. Data must be a string.\n\n",examples=>[{summary=>"Empty string is not a 
Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Data/Sah/Filter/perl/JSON/check_decode.pm ( view source; MetaCPAN )
:Filter::perl::JSON::check_decode;

use 5.010001;
use strict;
use warnings;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-11-15'; # DATE
our $DIST = 'Sah-Schemas-JSON'; # DIST
our 
'Check that value can be decoded as JSON',
        might_fail => 1,
        examples => [
            {value=>'', valid=>0, summary=>'Empty string is not valid JSON'},
            {value=>'null'},
   
 summary=>'Invalid JSON, missing closing quote'},
            {value=>{}, valid=>0, summary=>'Will become something like "HASH(0x560142d4e5e8)" and fail because it is not valid JSON'},
            #{v
Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Sah/Schema/json_str/array.pm ( view source; MetaCPAN )
package Sah::Schema::json_str::array;

use strict;
use warnings;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-11-15'; # DATE
our $DIST = 'Sah-Schemas-JSON'; # DIST
our $VERSION = 
A string that contains valid JSON and the JSON encodes an array',
    'prefilters' => ['JSON::check_decode_array'],
    description => <<'_',

This schema is like the `json_str` schema: it accepts a s
 JSON string will not be decoded but you know that the string
contains a valid JSON. In addition to that, the JSON must encode an array. Data
will not be valid if it is not a valid JSON or if the JSON
Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Sah/SchemaR/json_str/hash.pm ( view source; MetaCPAN )
emaR::json_str::hash;

our $DATE = '2022-11-15'; # DATE
our $VERSION = '0.007'; # VERSION

our $rschema = do{my$var={base=>"str",clsets_after_base=>[{description=>"\nThis schema is like the `json_str`
accepts a string that contains\nvalid JSON. The JSON string will not be decoded but you know that the string\ncontains a valid JSON. In addition to that, the JSON must encode a hash\n(JavaScript objec
t). Data will not be valid if it is not a valid JSON or if the\nJSON is not a hash.\n\nNote that unlike the `hash_from_json` schema, a hash data is not accepted by\nthis schema. Data must be a string.
Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Sah/Schema/json_str/hash.pm ( view source; MetaCPAN )
package Sah::Schema::json_str::hash;

use strict;
use warnings;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-11-15'; # DATE
our $DIST = 'Sah-Schemas-JSON'; # DIST
our $VERSION = '
that contains valid JSON and the JSON encodes a hash (JavaScript object)',
    'prefilters' => ['JSON::check_decode_hash'],
    description => <<'_',

This schema is like the `json_str` schema: it acc
epts a string that contains
valid JSON. The JSON string will not be decoded but you know that the string
contains a valid JSON. In addition to that, the JSON must encode a hash
(JavaScript object). Da
Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Data/Sah/Filter/perl/JSON/check_decode_array.pm ( view source; MetaCPAN )
lter::perl::JSON::check_decode_array;

use 5.010001;
use strict;
use warnings;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-11-15'; # DATE
our $DIST = 'Sah-Schemas-JSON'; # DIST
o
at value can be decoded as JSON and it is an array',
        might_fail => 1,
        examples => [
            {value=>'', valid=>0, summary=>'Empty string is not valid JSON'},
            {value=>'n
 JSON but not an array'},
            {value=>'[1,2,3]'},
            {value=>'{"a":1}', valid=>0, summary=>'Valid JSON but not an array'},
            {value=>'"foo"', valid=>0, summary=>'Valid JSON 
Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Sah/SchemaR/json_str.pm ( view source; MetaCPAN )
## no critic: TestingAndDebugging::RequireStrict
package Sah::SchemaR::json_str;

our $DATE = '2022-11-15'; # DATE
our $VERSION = '0.007'; # VERSION

our $rschema = do{my$var={base=>"str",clsets_after
string that contains valid JSON.\nThe JSON string will not be decoded (e.g. a JSON-encoded array will not beome an\narray) but you know that the string contains a valid JSON. Data will not be\nvalid i
g does not contain valid JSON.\n\nSee also related schema: `json_or_str`, `str::encoded_json`,\n`str::escaped_json`.\n\n",examples=>[{summary=>"Empty string is not a valid JSON",valid=>0,value=>""},{v
Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Sah/SchemaR/array_from_json.pm ( view source; MetaCPAN )
## no critic: TestingAndDebugging::RequireStrict
package Sah::SchemaR::array_from_json;

our $DATE = '2022-11-15'; # DATE
our $VERSION = '0.007'; # VERSION

our $rschema = do{my$var={base=>"array",cls
tains a JSON-encoded array.\nData will not be valid if the string does not contain valid JSON.\n\nNote that array data is accepted, unlike the `json_str::array` schema which only\naccepts JSON-encoded
mples=>[{summary=>"Empty string is not a valid JSON",valid=>0,value=>""},{summary=>"Valid JSON but not an array",valid=>0,value=>1},{summary=>"Valid JSON but not an array",valid=>0,value=>"{}"},{summa
Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Sah/Schema/array_from_json.pm ( view source; MetaCPAN )
kage Sah::Schema::array_from_json;

use strict;
use warnings;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-11-15'; # DATE
our $DIST = 'Sah-Schemas-JSON'; # DIST
our $VERSION = '0.
07'; # VERSION

our $schema = [array => {
    summary => 'Array, coercible from JSON string',
    'prefilters' => ['JSON::decode_str'],
    description => <<'_',

You can use this schema if you want t
ontains a JSON-encoded array.
Data will not be valid if the string does not contain valid JSON.

Note that array data is accepted, unlike the `json_str::array` schema which only
accepts JSON-encoded a
Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Data/Sah/Filter/perl/JSON/check_decode_hash.pm ( view source; MetaCPAN )
lter::perl::JSON::check_decode_hash;

use 5.010001;
use strict;
use warnings;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-11-15'; # DATE
our $DIST = 'Sah-Schemas-JSON'; # DIST
ou
hat value can be decoded as JSON and it is a hash',
        might_fail => 1,
        examples => [
            {value=>'', valid=>0, summary=>'Empty string is not valid JSON'},
            {value=>'nu
id JSON but not a hash'},
            {value=>'[1,2,3]', valid=>0, summary=>'Valid JSON but not a hash'},
            {value=>'{"a":1}'},
            {value=>'"foo"', valid=>0, summary=>'Valid JSON bu
Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Data/Sah/Filter/perl/JSON/decode_str.pm ( view source; MetaCPAN )
::Filter::perl::JSON::decode_str;

use 5.010001;
use strict;
use warnings;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-11-15'; # DATE
our $DIST = 'Sah-Schemas-JSON'; # DIST
our $
ary => 'Decode from JSON if string, otherwise leave as-is',
        might_fail => 1,
        examples => [
            {value=>'', valid=>0, summary=>'Empty string is not valid JSON'},
            {va
 {value=>'"foo"', filtered_value=>'foo'},
            {value=>'"foo', valid=>0, summary=>'Invalid JSON, missing closing quote'},
            {value=>{}, summary=>'Not a string, so passed as-is'},
    
Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Sah/SchemaR/json_or_str.pm ( view source; MetaCPAN )
## no critic: TestingAndDebugging::RequireStrict
package Sah::SchemaR::json_or_str;

our $DATE = '2022-11-15'; # DATE
our $VERSION = '0.007'; # VERSION

our $rschema = do{my$var={base=>"any",clsets_af
e\nscript as command-line argument or option, it will be tried to be JSON-decoded\nfirst. If the string does not contain valid JSON, it will be left as-is as\nstring.\n\nThis schema is convenient on t
lated schema: `json_str`, `str::encoded_json`, `str::escaped_json`.\n\n",examples=>[{summary=>"Empty string, left as-is as string",valid=>1,value=>""},{valid=>1,value=>1},{summary=>"JSON-decoded and b
Dancer ( Y/YA/YANICK/Dancer-1.3521.tar.gz, YANICK, 2023; MetaCPAN )
Dancer/lib/Dancer/Serializer/JSON.pm ( view source; MetaCPAN )
package Dancer::Serializer::JSON;
our $AUTHORITY = 'cpan:SUKRIA';
#ABSTRACT: serializer for handling JSON data
$Dancer::Serializer::JSON::VERSION = '1.3521';
use strict;
use warnings;
use Carp;
use Da
r::Abstract';


# helpers

sub from_json {
    my $s = Dancer::Serializer::JSON->new;
    $s->deserialize(@_);
}

sub to_json {
    my $s = Dancer::Serializer::JSON->new;
    $s->serialize(@_);
}

# c
sub loaded { Dancer::ModuleLoader->load_with_params('JSON', '-support_by_pp') }

sub init {
    my ($self) = @_;
    raise core_serializer => 'JSON is needed and is not installed'
      unless $self->
Sah-Schemas-JSON ( P/PE/PERLANCAR/Sah-Schemas-JSON-0.007.tar.gz, PERLANCAR, 2023; MetaCPAN )
Sah-Schemas-JSON/lib/Sah/Schema/any_from_json.pm ( view source; MetaCPAN )
ackage Sah::Schema::any_from_json;

use strict;
use warnings;

our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
our $DATE = '2022-11-15'; # DATE
our $DIST = 'Sah-Schemas-JSON'; # DIST
our $VERSION = '0.
VERSION

our $schema = [any => {
    summary => 'A data structure, coerced from JSON string',
    'prefilters' => ['JSON::decode_str'],
    description => <<'_',

You can use this schema if you want t
will be assumed to be a
JSON-encoded value and decoded. Data will not be valid if the string does not
contain valid JSON.

Thus, if you want to supply a string, you have to JSON-encode it.

_
    exam

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.