X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/503c034a5d0b5d063c846fbf464a9669fda4e1d5..02cbf4dabf8fb67ea72a2b3ce2fd49537d978bd7:/tools/mkcaniuse?ds=sidebyside diff --git a/tools/mkcaniuse b/tools/mkcaniuse index c181758..2c6c6a2 100755 --- a/tools/mkcaniuse +++ b/tools/mkcaniuse @@ -7,7 +7,7 @@ use JSON::PP; use File::stat; use Time::Piece; -our $VERSION = '1.02'; +our $VERSION = '1.03'; my %BROWSERJOIN = ( edge => 'ie', @@ -30,13 +30,12 @@ for (values %{ $data->{data} }) { } for (values %{ $data->{agents} }) { delete $_->{usage_global}; - shift @{ $_->{versions} } while !defined $_->{versions}->[0]; } while (my ($browser, $target) = each %BROWSERJOIN) { my $agent1 = delete $data->{agents}->{$browser} or next; my $agent2 = $data->{agents}->{$target} or next; - splice @{ $agent2->{versions} }, -3, 3, @{ $agent1->{versions} }; + push @{ $agent2->{version_list} }, @{ $agent1->{version_list} }; $agent2->{browser} = sprintf '%s (former %s)', $agent1->{browser}, $agent2->{browser}; @@ -46,6 +45,12 @@ while (my ($browser, $target) = each %BROWSERJOIN) { } } +for my $feature (values %{ $data->{data} }) { + while (my ($attr, $row) = each %{$feature}) { + delete $feature->{$attr} if ref $row eq '' and $row eq ''; + } +} + say "# automatically generated by $0"; print '+', pp($data);