Skip to content
This repository was archived by the owner on Jan 14, 2022. It is now read-only.

Commit adb657a

Browse files
authored
Merge pull request #85 from pwa-builder/ignore_shortcut_entries
Ignore shortcut entries
2 parents 735da23 + 5508303 commit adb657a

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

lib/validations.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,21 @@ function isExpectedValidationError(errorResult) {
4343

4444
function isExpectedCase(errorResult, w3cManifestInfo) {
4545
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...
4749

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) {
4955
const [icons, index, purpose] = errorParams
5056

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");
5361
}).length > 0
5462
}
5563

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pwabuilder-lib",
3-
"version": "2.1.9",
3+
"version": "2.1.10",
44
"description": "PWA Builder Core Library",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)