From 4433b794ebfb9d383c0a112a62686bae3ca4f0b2 Mon Sep 17 00:00:00 2001 From: Andrey Kutejko Date: Thu, 13 Oct 2022 23:11:20 +0200 Subject: [PATCH] Fix some type annotations --- src/index.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/index.js b/src/index.js index 4097367b..3ab96bda 100644 --- a/src/index.js +++ b/src/index.js @@ -302,22 +302,22 @@ class FaviconsWebpackPlugin { /** * Generate the favicons * - * @param {{content: Buffer | string, hash: string}} logo + * @param {{content: Buffer | string, hash: string}[]} logoFileSources * @param {Buffer | string} baseManifest - the content of the file from options.manifest * @param {import('webpack').Compilation} compilation * @param {string} outputPath */ generateFavicons(logoFileSources, baseManifest, compilation, outputPath) { + const logoFileSourceContents = logoFileSources.map( + (source) => source.content + ); + const resolvedPublicPath = getResolvedPublicPath( - getContentHash(...logoFileSources.map((s) => s.content)), + getContentHash(...logoFileSourceContents), compilation, this.options ); - const logoFileSourceContents = logoFileSources.map( - (source) => source.content - ); - /** @type {{[key: string]: any}} - the parsed manifest from options.manifest */ const parsedBaseManifest = typeof this.options.manifest === 'string' @@ -358,7 +358,7 @@ class FaviconsWebpackPlugin { * this is very fast but also very limited * it is the default mode for development * - * @param {Buffer | string} logoSource + * @param {(Buffer | string)[]} logoFileSources * @param {{[key: string]: any}} baseManifest * @param {import('webpack').Compilation} compilation * @param {string} resolvedPublicPath @@ -417,7 +417,7 @@ class FaviconsWebpackPlugin { * this is not as fast as the light mode but * supports all common browsers and devices * - * @param {Buffer | string} logoSource + * @param {(Buffer | string)[]} logoFileSources * @param {{[key: string]: any}} baseManifest * @param {import('webpack').Compilation} compilation * @param {string} resolvedPublicPath