From e3f7bc36d9966a9d7f49af0ec71337cc01138e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrg=C3=BCn=20Day=C4=B1o=C4=9Flu?= Date: Fri, 2 Feb 2024 23:15:34 +0100 Subject: [PATCH] Refactor generateHashes function signature --- lib/hash.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/hash.js b/lib/hash.js index 82f7a4f..2943d61 100644 --- a/lib/hash.js +++ b/lib/hash.js @@ -21,13 +21,13 @@ async function generateFileHash (filePath) { * Can be used both at build time and runtime. * * @param {string|string[]} rootPaths - A single root directory or an array of root directories to process. - * @param {string|string[]} ignore - An array of glob patterns to ignore. - * @param {boolean} includeDotFiles - Whether to include dot files. + * @param {string|string[]|undefined} ignore - An array of glob patterns to ignore. + * @param {boolean} [includeDotFiles] - Whether to include dot files. * @param {boolean} [writeToFile] - Whether to write the hash map to a file (for build) or return it (for runtime). * @param {string} [outputPath='.tmp/hashes.json'] - The output file path, if writing to a file. * @returns {Promise>} - Returns nothing if writing to a file, or the hash map if not. */ -async function generateHashes (rootPaths, ignore, includeDotFiles, writeToFile = false, outputPath = '.tmp/hashes.json') { +async function generateHashes (rootPaths, ignore, includeDotFiles = false, writeToFile = false, outputPath = '.tmp/hashes.json') { const fileHashes = new Map() const roots = Array.isArray(rootPaths) ? rootPaths : [rootPaths]