| 1 |
NAME |
| 2 |
Data::Sah::Normalize - Normalize Sah schema |
| 3 |
|
| 4 |
VERSION |
| 5 |
This document describes version 0.051 of Data::Sah::Normalize (from Perl |
| 6 |
distribution Data-Sah-Normalize), released on 2021-07-29. |
| 7 |
|
| 8 |
SYNOPSIS |
| 9 |
use Data::Sah::Normalize qw(normalize_clset normalize_schema); |
| 10 |
|
| 11 |
my $nclset = normalize_clset({'!a'=>1}); # -> {a=>1, 'a.op'=>'not'} |
| 12 |
my $nsch = normalize_schema("int"); # -> ["int", {}] |
| 13 |
|
| 14 |
DESCRIPTION |
| 15 |
This often-needed functionality is split from the main Data::Sah to keep |
| 16 |
it in a small and minimal-dependencies package. |
| 17 |
|
| 18 |
CONTRIBUTOR |
| 19 |
Steven Haryanto <[email protected]> |
| 20 |
|
| 21 |
FUNCTIONS |
| 22 |
normalize_clset($clset) => HASH |
| 23 |
Normalize a clause set (hash). Return a shallow copy of the original |
| 24 |
hash. Die on failure. |
| 25 |
|
| 26 |
TODO: option to recursively normalize clause which contains sah clauses |
| 27 |
(e.g. "of"). |
| 28 |
|
| 29 |
normalize_schema($sch) => ARRAY |
| 30 |
Normalize a Sah schema (scalar or array). Return an array. Produce a |
| 31 |
2-level copy of schema, so it's safe to add/delete/modify the normalized |
| 32 |
schema's clause set, but clause set's values are still references to the |
| 33 |
original. Die on failure. |
| 34 |
|
| 35 |
TODO: recursively normalize clause which contains sah clauses (e.g. |
| 36 |
"of"). |
| 37 |
|
| 38 |
HOMEPAGE |
| 39 |
Please visit the project's homepage at |
| 40 |
<https://metacpan.org/release/Data-Sah-Normalize>. |
| 41 |
|
| 42 |
SOURCE |
| 43 |
Source repository is at |
| 44 |
<https://github.com/perlancar/perl-Data-Sah-Normalize>. |
| 45 |
|
| 46 |
BUGS |
| 47 |
Please report any bugs or feature requests on the bugtracker website |
| 48 |
<https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Sah-Normalize> |
| 49 |
|
| 50 |
When submitting a bug or request, please include a test-file or a patch |
| 51 |
to an existing test-file that illustrates the bug or desired feature. |
| 52 |
|
| 53 |
SEE ALSO |
| 54 |
Sah, Data::Sah |
| 55 |
|
| 56 |
AUTHOR |
| 57 |
perlancar <[email protected]> |
| 58 |
|
| 59 |
COPYRIGHT AND LICENSE |
| 60 |
This software is copyright (c) 2021, 2018, 2015, 2014 by |
| 61 |
[email protected]. |
| 62 |
|
| 63 |
This is free software; you can redistribute it and/or modify it under |
| 64 |
the same terms as the Perl 5 programming language system itself. |
| 65 |
|