Skip to content

Commit 928543d

Browse files
committed
Add getA11yScore function to retrieve accessibility score from report categories
1 parent 50d61c7 commit 928543d

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

definitions/functions.sqlx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
config {
2+
type: 'operations'
3+
}
4+
5+
CREATE FUNCTION IF NOT EXISTS `httparchive.fn.getA11yScore`(reportCategories JSON)
6+
RETURNS FLOAT64 DETERMINISTIC
7+
LANGUAGE js AS """
8+
if(reportCategories) {
9+
return reportCategories.find(i => i.name === 'Accessibility').score;
10+
}
11+
""";

0 commit comments

Comments
 (0)