browser: coalesce duplicate agent version in caniuse data
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 15 Nov 2021 18:12:57 +0000 (19:12 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 6 Dec 2021 11:07:29 +0000 (12:07 +0100)
Development version 95 in android is joined with and_chr.

tools/mkcaniuse

index 2d9759e9d6895674050d0dcd5adca55ca867cfe7..f72122b6f309538a494d027a27d1194ac3068d76 100755 (executable)
@@ -6,6 +6,7 @@ use Data::Dump 'pp';
 use JSON::PP;
 use File::stat;
 use Time::Piece;
+use List::Util 'uniq';
 
 our $VERSION = '1.03';
 
@@ -55,6 +56,10 @@ for my $feature (values %{ $data->{data} }) {
        }
 }
 
+while (my ($agent, $row) = each %{ $data->{agents} }) {
+       $row->{versions} = [ uniq map { $_->{version} } @{ $row->{version_list} } ];
+}
+
 say "# automatically generated by $0";
 print '+', pp($data);