MCPcopy
hub / github.com/angular/angular / tmpHashTableForFs

Function tmpHashTableForFs

packages/service-worker/worker/testing/mock.ts:274–291  ·  view source on GitHub ↗
(
  fs: MockFileSystem,
  breakHashes: {[url: string]: boolean} = {},
  baseHref = '/',
)

Source from the content-addressed store, hash-verified

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

Callers 6

happy_spec.tsFile · 0.90
generateMockServerStateFunction · 0.90
data_spec.tsFile · 0.90

Calls 6

joinPathsFunction · 0.85
reverseMethod · 0.80
listMethod · 0.65
joinMethod · 0.65
forEachMethod · 0.45
lookupMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…