Skip to content

Commit

Permalink
Refactor generateHashes function signature
Browse files Browse the repository at this point in the history
  • Loading branch information
gurgunday committed Feb 2, 2024
1 parent efa2900 commit e3f7bc3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<void|Map<string, string>>} - 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]

Expand Down

0 comments on commit e3f7bc3

Please sign in to comment.