@realfavicongenerator/check-favicon 0.3.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/touch-icon.js +0 -8
- package/dist/touch-icon.test.js +0 -37
- package/package.json +2 -2
- package/src/touch-icon.test.ts +0 -39
- package/src/touch-icon.ts +0 -9
package/dist/touch-icon.js
CHANGED
|
@@ -82,14 +82,6 @@ const checkTouchIconIcon = (baseUrl_2, head_2, ...args_2) => __awaiter(void 0, [
|
|
|
82
82
|
id: types_1.MessageId.touchIconDeclared,
|
|
83
83
|
text: 'The touch icon is declared'
|
|
84
84
|
});
|
|
85
|
-
const sizes = iconMarkup.map(icon => icon.getAttribute('sizes')).filter(size => size);
|
|
86
|
-
if (sizes.length > 0) {
|
|
87
|
-
messages.push({
|
|
88
|
-
status: types_1.CheckerStatus.Warning,
|
|
89
|
-
id: types_1.MessageId.touchIconWithSize,
|
|
90
|
-
text: `Some Touch icon have a specific size (${sizes.join(', ')})`
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
85
|
const duplicatedSizes = (0, exports.getDuplicatedSizes)(iconMarkup.map(icon => icon.getAttribute('sizes')));
|
|
94
86
|
if (duplicatedSizes.length > 0) {
|
|
95
87
|
messages.push({
|
package/dist/touch-icon.test.js
CHANGED
|
@@ -73,23 +73,6 @@ test('checkTouchIcon - noTouchIcon', () => __awaiter(void 0, void 0, void 0, fun
|
|
|
73
73
|
id: types_1.MessageId.noTouchIcon,
|
|
74
74
|
}] });
|
|
75
75
|
}));
|
|
76
|
-
test('checkTouchIcon - touchIconWithSize', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
77
|
-
yield runCheckTouchIconTest(`
|
|
78
|
-
<link rel="apple-touch-icon" sizes="152x152" href="some-other-icon.png">
|
|
79
|
-
`, { messages: [{
|
|
80
|
-
status: types_1.CheckerStatus.Ok,
|
|
81
|
-
id: types_1.MessageId.touchIconDeclared,
|
|
82
|
-
}, {
|
|
83
|
-
status: types_1.CheckerStatus.Warning,
|
|
84
|
-
id: types_1.MessageId.touchIconWithSize,
|
|
85
|
-
}] }, {
|
|
86
|
-
'https://example.com/some-other-icon.png': {
|
|
87
|
-
status: 200,
|
|
88
|
-
contentType: 'image/png',
|
|
89
|
-
readableStream: null
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
}));
|
|
93
76
|
test('checkTouchIcon - multipleTouchIcon - no size', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
94
77
|
yield runCheckTouchIconTest(`
|
|
95
78
|
<link rel="apple-touch-icon" href="some-icon.png">
|
|
@@ -120,9 +103,6 @@ test('checkTouchIcon - multipleTouchIcon - specific size', () => __awaiter(void
|
|
|
120
103
|
`, { messages: [{
|
|
121
104
|
status: types_1.CheckerStatus.Ok,
|
|
122
105
|
id: types_1.MessageId.touchIconDeclared,
|
|
123
|
-
}, {
|
|
124
|
-
status: types_1.CheckerStatus.Warning,
|
|
125
|
-
id: types_1.MessageId.touchIconWithSize,
|
|
126
106
|
}, {
|
|
127
107
|
status: types_1.CheckerStatus.Error,
|
|
128
108
|
id: types_1.MessageId.duplicatedTouchIconSizes,
|
|
@@ -139,23 +119,6 @@ test('checkTouchIcon - multipleTouchIcon - specific size', () => __awaiter(void
|
|
|
139
119
|
}
|
|
140
120
|
});
|
|
141
121
|
}));
|
|
142
|
-
test('checkTouchIcon - touchIconWithSize', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
143
|
-
yield runCheckTouchIconTest(`
|
|
144
|
-
<link rel="apple-touch-icon" sizes="180x180" href="some-other-icon.png">
|
|
145
|
-
`, { messages: [{
|
|
146
|
-
status: types_1.CheckerStatus.Ok,
|
|
147
|
-
id: types_1.MessageId.touchIconDeclared,
|
|
148
|
-
}, {
|
|
149
|
-
status: types_1.CheckerStatus.Warning,
|
|
150
|
-
id: types_1.MessageId.touchIconWithSize,
|
|
151
|
-
}] }, {
|
|
152
|
-
'https://example.com/some-other-icon.png': {
|
|
153
|
-
status: 200,
|
|
154
|
-
contentType: 'image/png',
|
|
155
|
-
readableStream: null
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
}));
|
|
159
122
|
const testIcon = './fixtures/180x180.png';
|
|
160
123
|
test('checkTouchIcon - Regular case', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
161
124
|
yield runCheckTouchIconTest(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@realfavicongenerator/check-favicon",
|
|
3
|
-
"version": "0.3
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "Check the favicon of a website",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"node-html-parser": "^6.1.13",
|
|
39
39
|
"sharp": "^0.32.6"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "521809bb438faddd63218e736f20f89ffb2cab71"
|
|
42
42
|
}
|
package/src/touch-icon.test.ts
CHANGED
|
@@ -88,24 +88,6 @@ test('checkTouchIcon - noTouchIcon', async () => {
|
|
|
88
88
|
}]});
|
|
89
89
|
})
|
|
90
90
|
|
|
91
|
-
test('checkTouchIcon - touchIconWithSize', async () => {
|
|
92
|
-
await runCheckTouchIconTest(`
|
|
93
|
-
<link rel="apple-touch-icon" sizes="152x152" href="some-other-icon.png">
|
|
94
|
-
`, { messages: [{
|
|
95
|
-
status: CheckerStatus.Ok,
|
|
96
|
-
id: MessageId.touchIconDeclared,
|
|
97
|
-
}, {
|
|
98
|
-
status: CheckerStatus.Warning,
|
|
99
|
-
id: MessageId.touchIconWithSize,
|
|
100
|
-
}]}, {
|
|
101
|
-
'https://example.com/some-other-icon.png': {
|
|
102
|
-
status: 200,
|
|
103
|
-
contentType: 'image/png',
|
|
104
|
-
readableStream: null
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
})
|
|
108
|
-
|
|
109
91
|
test('checkTouchIcon - multipleTouchIcon - no size', async () => {
|
|
110
92
|
await runCheckTouchIconTest(`
|
|
111
93
|
<link rel="apple-touch-icon" href="some-icon.png">
|
|
@@ -137,9 +119,6 @@ test('checkTouchIcon - multipleTouchIcon - specific size', async () => {
|
|
|
137
119
|
`, { messages: [{
|
|
138
120
|
status: CheckerStatus.Ok,
|
|
139
121
|
id: MessageId.touchIconDeclared,
|
|
140
|
-
}, {
|
|
141
|
-
status: CheckerStatus.Warning,
|
|
142
|
-
id: MessageId.touchIconWithSize,
|
|
143
122
|
}, {
|
|
144
123
|
status: CheckerStatus.Error,
|
|
145
124
|
id: MessageId.duplicatedTouchIconSizes,
|
|
@@ -157,24 +136,6 @@ test('checkTouchIcon - multipleTouchIcon - specific size', async () => {
|
|
|
157
136
|
});
|
|
158
137
|
})
|
|
159
138
|
|
|
160
|
-
test('checkTouchIcon - touchIconWithSize', async () => {
|
|
161
|
-
await runCheckTouchIconTest(`
|
|
162
|
-
<link rel="apple-touch-icon" sizes="180x180" href="some-other-icon.png">
|
|
163
|
-
`, { messages: [{
|
|
164
|
-
status: CheckerStatus.Ok,
|
|
165
|
-
id: MessageId.touchIconDeclared,
|
|
166
|
-
}, {
|
|
167
|
-
status: CheckerStatus.Warning,
|
|
168
|
-
id: MessageId.touchIconWithSize,
|
|
169
|
-
}]}, {
|
|
170
|
-
'https://example.com/some-other-icon.png': {
|
|
171
|
-
status: 200,
|
|
172
|
-
contentType: 'image/png',
|
|
173
|
-
readableStream: null
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
})
|
|
177
|
-
|
|
178
139
|
const testIcon = './fixtures/180x180.png';
|
|
179
140
|
|
|
180
141
|
test('checkTouchIcon - Regular case', async () => {
|
package/src/touch-icon.ts
CHANGED
|
@@ -88,15 +88,6 @@ export const checkTouchIconIcon = async (baseUrl: string, head: HTMLElement | nu
|
|
|
88
88
|
text: 'The touch icon is declared'
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
-
const sizes = iconMarkup.map(icon => icon.getAttribute('sizes')).filter(size => size);
|
|
92
|
-
if (sizes.length > 0) {
|
|
93
|
-
messages.push({
|
|
94
|
-
status: CheckerStatus.Warning,
|
|
95
|
-
id: MessageId.touchIconWithSize,
|
|
96
|
-
text: `Some Touch icon have a specific size (${sizes.join(', ')})`
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
91
|
const duplicatedSizes = getDuplicatedSizes(iconMarkup.map(icon => icon.getAttribute('sizes')));
|
|
101
92
|
if (duplicatedSizes.length > 0) {
|
|
102
93
|
messages.push({
|