@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.
@@ -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 = 48;
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>;
@@ -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 = 48;
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.no48x48DesktopPngFavicon,
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
- no48x48DesktopPngFavicon = 21,
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["no48x48DesktopPngFavicon"] = 21] = "no48x48DesktopPngFavicon";
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.5",
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": "ff517731a374ff42747e65aa036b064d1a1f1aa1"
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
  })
@@ -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 = 48;
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.no48x48DesktopPngFavicon,
131
+ id: MessageId.no96x96DesktopPngFavicon,
132
132
  text: `There is no ${size} desktop PNG favicon`
133
133
  });
134
134
  } else {
package/src/types.ts CHANGED
@@ -30,7 +30,7 @@ export enum MessageId {
30
30
  icoFaviconExpectedSizes,
31
31
 
32
32
  noDesktopPngFavicon,
33
- no48x48DesktopPngFavicon,
33
+ no96x96DesktopPngFavicon,
34
34
  desktopPngFaviconDeclared,
35
35
  noDesktopPngFaviconHref,
36
36
  desktopPngFaviconCannotGet,