This repository was archived by the owner on Jan 14, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -43,13 +43,21 @@ function isExpectedValidationError(errorResult) {
43
43
44
44
function isExpectedCase ( errorResult , w3cManifestInfo ) {
45
45
const errorParams = errorResult . member . split ( '/' ) . slice ( 1 ) //example: /icons/0/purpose -> ['icons', '0', 'purpose']
46
- const isIconsPurpose = errorResult . member . includes ( "icons" ) && errorResult . member . includes ( "purpose" )
46
+ const isIconsPurpose = errorResult . member . includes ( "icons" ) && errorResult . member . includes ( "purpose" ) ;
47
+ const isShortcuts = errorResult . member . includes ( "shortcuts" ) ;
48
+ const isScreenshots = errorResult . member . includes ( "screenshots" ) ; // in the case we need to extend it to screenshots as well...
47
49
48
- if ( isIconsPurpose ) {
50
+ if ( ( isScreenshots || isShortcuts ) && isIconsPurpose ) {
51
+ // don't handle, just let it go through
52
+ return true ;
53
+
54
+ } else if ( isIconsPurpose ) {
49
55
const [ icons , index , purpose ] = errorParams
50
56
51
- return w3cManifestInfo . content [ icons ] [ index ] [ purpose ] . split ( " " ) . filter ( entry => {
52
- return ( entry === "any" || entry === "maskable" || entry === "monochrome" ) ;
57
+ return w3cManifestInfo . content . icons
58
+ && w3cManifestInfo . content . icons [ index ]
59
+ && w3cManifestInfo . content . icons [ index ] . purpose . split ( " " ) . filter ( entry => {
60
+ return ( entry === "any" || entry === "maskable" || entry === "monochrome" ) ;
53
61
} ) . length > 0
54
62
}
55
63
You can’t perform that action at this time.
0 commit comments