@realfavicongenerator/check-favicon 0.4.5 → 0.4.6
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/desktop/desktop.d.ts +1 -1
- package/dist/desktop/desktop.js +2 -2
- package/dist/desktop/desktop.test.js +7 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/fixtures/96x96.png +0 -0
- package/package.json +2 -2
- package/src/desktop/desktop.test.ts +7 -0
- package/src/desktop/desktop.ts +2 -2
- package/src/types.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CheckerMessage, DesktopFaviconReport, Fetcher } from "../types";
|
|
2
2
|
import { HTMLElement } from 'node-html-parser';
|
|
3
|
-
export declare const PngFaviconFileSize =
|
|
3
|
+
export declare const PngFaviconFileSize = 96;
|
|
4
4
|
export declare const checkSvgFavicon: (baseUrl: string, head: HTMLElement | null, fetcher?: Fetcher) => Promise<CheckerMessage[]>;
|
|
5
5
|
export declare const checkSvgFaviconFile: (baseUrl: string, url: string, fetcher: Fetcher) => Promise<CheckerMessage[]>;
|
|
6
6
|
export declare const checkPngFavicon: (baseUrl: string, head: HTMLElement | null, fetcher?: Fetcher) => Promise<DesktopFaviconReport>;
|
package/dist/desktop/desktop.js
CHANGED
|
@@ -17,7 +17,7 @@ const types_1 = require("../types");
|
|
|
17
17
|
const sharp_1 = __importDefault(require("sharp"));
|
|
18
18
|
const helper_1 = require("../helper");
|
|
19
19
|
const ico_1 = require("./ico");
|
|
20
|
-
exports.PngFaviconFileSize =
|
|
20
|
+
exports.PngFaviconFileSize = 96;
|
|
21
21
|
const checkSvgFavicon = (baseUrl_1, head_1, ...args_1) => __awaiter(void 0, [baseUrl_1, head_1, ...args_1], void 0, function* (baseUrl, head, fetcher = helper_1.fetchFetcher) {
|
|
22
22
|
const messages = [];
|
|
23
23
|
if (!head) {
|
|
@@ -133,7 +133,7 @@ const checkPngFavicon = (baseUrl_2, head_2, ...args_2) => __awaiter(void 0, [bas
|
|
|
133
133
|
if (sizedIconMarkup.length === 0) {
|
|
134
134
|
messages.push({
|
|
135
135
|
status: types_1.CheckerStatus.Error,
|
|
136
|
-
id: types_1.MessageId.
|
|
136
|
+
id: types_1.MessageId.no96x96DesktopPngFavicon,
|
|
137
137
|
text: `There is no ${size} desktop PNG favicon`
|
|
138
138
|
});
|
|
139
139
|
}
|
|
@@ -104,11 +104,13 @@ const runPngTest = (headFragment_2, output_2, ...args_2) => __awaiter(void 0, [h
|
|
|
104
104
|
const testIcon16 = './fixtures/16x16.png';
|
|
105
105
|
const testIcon32 = './fixtures/32x32.png';
|
|
106
106
|
const testIcon48 = './fixtures/48x48.png';
|
|
107
|
+
const testIcon96 = './fixtures/96x96.png';
|
|
107
108
|
test('checkSvgFavicon - Three PNG icons with different sizes', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
108
109
|
yield runPngTest(`
|
|
109
110
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
|
|
110
111
|
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
|
|
111
112
|
<link rel="icon" type="image/png" sizes="48x48" href="/favicon/favicon-48x48.png">
|
|
113
|
+
<link rel="icon" type="image/png" sizes="96x96" href="/favicon/favicon-96x96.png">
|
|
112
114
|
`, [{
|
|
113
115
|
status: types_1.CheckerStatus.Ok,
|
|
114
116
|
id: types_1.MessageId.desktopPngFaviconDeclared,
|
|
@@ -133,6 +135,11 @@ test('checkSvgFavicon - Three PNG icons with different sizes', () => __awaiter(v
|
|
|
133
135
|
status: 200,
|
|
134
136
|
contentType: 'image/png',
|
|
135
137
|
readableStream: yield (0, helper_1.filePathToReadableStream)(testIcon48),
|
|
138
|
+
},
|
|
139
|
+
'https://example.com/favicon/favicon-96x96.png': {
|
|
140
|
+
status: 200,
|
|
141
|
+
contentType: 'image/png',
|
|
142
|
+
readableStream: yield (0, helper_1.filePathToReadableStream)(testIcon96),
|
|
136
143
|
}
|
|
137
144
|
});
|
|
138
145
|
}));
|
package/dist/types.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export declare enum MessageId {
|
|
|
25
25
|
icoFaviconMissingSizes = 18,
|
|
26
26
|
icoFaviconExpectedSizes = 19,
|
|
27
27
|
noDesktopPngFavicon = 20,
|
|
28
|
-
|
|
28
|
+
no96x96DesktopPngFavicon = 21,
|
|
29
29
|
desktopPngFaviconDeclared = 22,
|
|
30
30
|
noDesktopPngFaviconHref = 23,
|
|
31
31
|
desktopPngFaviconCannotGet = 24,
|
package/dist/types.js
CHANGED
|
@@ -30,7 +30,7 @@ var MessageId;
|
|
|
30
30
|
MessageId[MessageId["icoFaviconMissingSizes"] = 18] = "icoFaviconMissingSizes";
|
|
31
31
|
MessageId[MessageId["icoFaviconExpectedSizes"] = 19] = "icoFaviconExpectedSizes";
|
|
32
32
|
MessageId[MessageId["noDesktopPngFavicon"] = 20] = "noDesktopPngFavicon";
|
|
33
|
-
MessageId[MessageId["
|
|
33
|
+
MessageId[MessageId["no96x96DesktopPngFavicon"] = 21] = "no96x96DesktopPngFavicon";
|
|
34
34
|
MessageId[MessageId["desktopPngFaviconDeclared"] = 22] = "desktopPngFaviconDeclared";
|
|
35
35
|
MessageId[MessageId["noDesktopPngFaviconHref"] = 23] = "noDesktopPngFaviconHref";
|
|
36
36
|
MessageId[MessageId["desktopPngFaviconCannotGet"] = 24] = "desktopPngFaviconCannotGet";
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@realfavicongenerator/check-favicon",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"description": "Check the favicon of a website",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"node-html-parser": "^6.1.13",
|
|
40
40
|
"sharp": "^0.32.6"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "f62941a779e6ce1b49ad97bfea8a9eb71e7ceba5"
|
|
43
43
|
}
|
|
@@ -114,12 +114,14 @@ const runPngTest = async (
|
|
|
114
114
|
const testIcon16 = './fixtures/16x16.png';
|
|
115
115
|
const testIcon32 = './fixtures/32x32.png';
|
|
116
116
|
const testIcon48 = './fixtures/48x48.png';
|
|
117
|
+
const testIcon96 = './fixtures/96x96.png';
|
|
117
118
|
|
|
118
119
|
test('checkSvgFavicon - Three PNG icons with different sizes', async () => {
|
|
119
120
|
await runPngTest(`
|
|
120
121
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png">
|
|
121
122
|
<link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png">
|
|
122
123
|
<link rel="icon" type="image/png" sizes="48x48" href="/favicon/favicon-48x48.png">
|
|
124
|
+
<link rel="icon" type="image/png" sizes="96x96" href="/favicon/favicon-96x96.png">
|
|
123
125
|
`, [{
|
|
124
126
|
status: CheckerStatus.Ok,
|
|
125
127
|
id: MessageId.desktopPngFaviconDeclared,
|
|
@@ -145,6 +147,11 @@ test('checkSvgFavicon - Three PNG icons with different sizes', async () => {
|
|
|
145
147
|
status: 200,
|
|
146
148
|
contentType: 'image/png',
|
|
147
149
|
readableStream: await filePathToReadableStream(testIcon48),
|
|
150
|
+
},
|
|
151
|
+
'https://example.com/favicon/favicon-96x96.png': {
|
|
152
|
+
status: 200,
|
|
153
|
+
contentType: 'image/png',
|
|
154
|
+
readableStream: await filePathToReadableStream(testIcon96),
|
|
148
155
|
}
|
|
149
156
|
});
|
|
150
157
|
})
|
package/src/desktop/desktop.ts
CHANGED
|
@@ -4,7 +4,7 @@ import sharp from 'sharp'
|
|
|
4
4
|
import { CheckIconProcessor, checkIcon, fetchFetcher, mergeUrlAndPath, readableStreamToString } from "../helper";
|
|
5
5
|
import { checkIcoFavicon } from "./ico";
|
|
6
6
|
|
|
7
|
-
export const PngFaviconFileSize =
|
|
7
|
+
export const PngFaviconFileSize = 96;
|
|
8
8
|
|
|
9
9
|
export const checkSvgFavicon = async (baseUrl: string, head: HTMLElement | null, fetcher: Fetcher = fetchFetcher): Promise<CheckerMessage[]> => {
|
|
10
10
|
const messages: CheckerMessage[] = [];
|
|
@@ -128,7 +128,7 @@ export const checkPngFavicon = async (baseUrl: string, head: HTMLElement | null,
|
|
|
128
128
|
if (sizedIconMarkup.length === 0) {
|
|
129
129
|
messages.push({
|
|
130
130
|
status: CheckerStatus.Error,
|
|
131
|
-
id: MessageId.
|
|
131
|
+
id: MessageId.no96x96DesktopPngFavicon,
|
|
132
132
|
text: `There is no ${size} desktop PNG favicon`
|
|
133
133
|
});
|
|
134
134
|
} else {
|