(
fs: MockFileSystem,
breakHashes: {[url: string]: boolean} = {},
baseHref = '/',
)
| 267 | } |
| 268 | |
| 269 | export function tmpHashTableForFs( |
| 270 | fs: MockFileSystem, |
| 271 | breakHashes: {[url: string]: boolean} = {}, |
| 272 | baseHref = '/', |
| 273 | ): {[url: string]: string} { |
| 274 | const table: {[url: string]: string} = {}; |
| 275 | fs.list().forEach((filePath) => { |
| 276 | const urlPath = joinPaths(baseHref, filePath); |
| 277 | const file = fs.lookup(filePath)!; |
| 278 | if (file.hashThisFile) { |
| 279 | table[urlPath] = file.hash; |
| 280 | if (breakHashes[filePath]) { |
| 281 | table[urlPath] = table[urlPath].split('').reverse().join(''); |
| 282 | } |
| 283 | } |
| 284 | }); |
| 285 | return table; |
| 286 | } |
| 287 | |
| 288 | export function tmpHashTable(manifest: Manifest): Map<string, string> { |
| 289 | const map = new Map<string, string>(); |
no test coverage detected