Skip to content

Commit

Permalink
add icon-must-be-png rule
Browse files Browse the repository at this point in the history
  • Loading branch information
Manh Cao committed Sep 20, 2024
1 parent 0c50d38 commit 4c04840
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions validate-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ function validateConfig(protocol) {
throw new Error(`protocol ${protocol}: invalid field 'icon'`);
}

if (!(icon.endsWith('.png') && icon.length > 4)) {
throw new Error(`protocol ${protocol}: icon must be a valid png image`);
}

if (typeof metadata !== 'object') {
throw new Error(`protocol ${protocol}: invalid field 'metadata'`);
}
Expand Down

0 comments on commit 4c04840

Please sign in to comment.