What does the 'hashFiles()' function return when used as a cache key?
Select an answer to reveal the explanation.
Short Explanation and Infographic
hashFiles() fingerprints your dependency files — when package.json changes, the hash changes, busting the cache exactly when you need it.
Full explanation below image
Full Explanation
hashFiles() accepts glob patterns and returns a SHA-256 hash of the combined content of all matching files. It's primarily used for cache keys: 'hashFiles("/package-lock.json")' produces a new hash whenever lock file contents change, invalidating the cache. If no files match, it returns an empty string. The function accepts multiple patterns: hashFiles('/package-lock.json', '**/yarn.lock'). It does not return file sizes, timestamps, or run IDs. The hash is computed in a reproducible way so identical file contents produce identical hashes.