Data::Sah::Tiny - Validate Sah schemas with as little code as possible
This document describes version 0.000 of Data::Sah::Tiny (from Perl distribution Data-Sah-Tiny), released on 2020-05-10.
use Data::Sah::Tiny qw(normalize_schema gen_validator); my $v = gen_validator([int => min=>1]); say $v->(0); # false say $v->(2); # true
Early release. Not all types and clauses are supported.
This is a tiny alternative to Data::Sah, with fewer dependencies and much faster compilation speed. But it supports only a subset of Data::Sah's features.
Validator generation is several times faster than Data::Sah, so Params::Sah with Data::Sah::Tiny backend is in the same order of magnitude with other validator generators like Type::Params and Params::ValidationCompiler. See Bencher::Scenarios::ParamsSah.
See Data::Sah's documentation. Supported options:
schema_is_normalized
Bool.
return_type
Str. Only "bool_valid" and "bool_valid+val" are supported.
data_term
Str. Defaults to $_[0].
$_[0]
source
Bool. Set to 1 to return source code instead of compiled coderef.
hash*
Bool. If set to 1 will return compilation result details.
See Data::Sah::Normalize's documentation.
Please visit the project's homepage at https://metacpan.org/release/Data-Sah-Tiny.
Source repository is at https://github.com/perlancar/perl-Data-Sah-Tiny.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Sah-Tiny
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Data::Sah
perlancar <perlancar@cpan.org>
This software is copyright (c) 2020 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Data::Sah::Tiny, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::Sah::Tiny
CPAN shell
perl -MCPAN -e shell install Data::Sah::Tiny
For more information on module installation, please visit the detailed CPAN module installation guide.