browser: delete unused data from caniuse include
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 26 Apr 2017 21:20:40 +0000 (23:20 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 29 May 2017 16:51:17 +0000 (18:51 +0200)
tools/mkcaniuse

index 07531d4..57b36fc 100755 (executable)
@@ -19,6 +19,14 @@ my $data = decode_json($source);
 my $update = eval { stat(${^LAST_FH} // $ARGV)->mtime }
        or warn "Could not determine input time\n";
 $data->{-date} = Time::Piece->new($update)->datetime;
+delete $data->{eras};
+for (values %{ $data->{data} }) {
+       delete @{$_}{qw[ usage_perc_a usage_perc_y ]};
+}
+for (values %{ $data->{agents} }) {
+       delete $_->{usage_global};
+       shift @{ $_->{versions} } while !defined $_->{versions}->[0];
+}
 
 say "# automatically generated by $0";
 print '+', pp($data);