@@ -4,17 +4,11 @@ import yargs from "yargs";
44import { features } from "../index.js" ;
55import { isOrdinaryFeatureData } from "../type-guards.js" ;
66
7- const argv = yargs ( process . argv . slice ( 2 ) )
7+ yargs ( process . argv . slice ( 2 ) )
88 . scriptName ( "stats" )
9- . usage ( "$0" , "Generate statistics" )
10- . option ( "verbose" , {
11- alias : "v" ,
12- describe : "Show more detailed stats" ,
13- type : "count" ,
14- default : 0 ,
15- } ) . argv ;
9+ . usage ( "$0" , "Generate statistics" ) . argv ;
1610
17- export function stats ( detailed : boolean = false ) {
11+ export function stats ( ) {
1812 const featureCount = Object . values ( features ) . filter (
1913 isOrdinaryFeatureData ,
2014 ) . length ;
@@ -30,17 +24,10 @@ export function stats(detailed: boolean = false) {
3024 } ) ,
3125 ) ,
3226 ) ;
33- const toDoKeys = [ ] ;
3427
3528 for ( const f of new Compat ( ) . walk ( ) ) {
3629 if ( ! f . id . startsWith ( "webextensions" ) ) {
3730 keys . push ( f . id ) ;
38-
39- if ( ! f . deprecated && f . standard_track ) {
40- if ( ! doneKeys . includes ( f . id ) ) {
41- toDoKeys . push ( f . id ) ;
42- }
43- }
4431 }
4532 }
4633
@@ -71,19 +58,13 @@ export function stats(detailed: boolean = false) {
7158 . sort ( ( [ , frequencyA ] , [ , frequencyB ] ) => frequencyA - frequencyB )
7259 . pop ( ) [ 0 ] ;
7360 } ) ( ) ,
74- currentBurndown : undefined ,
75- currentBurndownSize : toDoKeys . length ,
7661 } ;
7762
78- if ( detailed ) {
79- result . currentBurndown = toDoKeys ;
80- }
81-
8263 return result ;
8364}
8465
8566if ( import . meta. url . startsWith ( "file:" ) ) {
8667 if ( process . argv [ 1 ] === fileURLToPath ( import . meta. url ) ) {
87- console . log ( JSON . stringify ( stats ( argv . verbose ) , undefined , 2 ) ) ;
68+ console . log ( JSON . stringify ( stats ( ) , undefined , 2 ) ) ;
8869 }
8970}
0 commit comments