MCPcopy Create free account
hub / github.com/angular/angular / tmpHashTableForFs

Function tmpHashTableForFs

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

Source from the content-addressed store, hash-verified

267}
268
269export 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
288export function tmpHashTable(manifest: Manifest): Map<string, string> {
289 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