MCPcopy Create free account
hub / github.com/angular/components / writeUpdates

Function writeUpdates

src/material/schematics/migration-utilities/update.ts:19–23  ·  view source on GitHub ↗
(content: string, updates: Update[])

Source from the content-addressed store, hash-verified

17
18/** Applies the updates to the given file content in reverse offset order. */
19export function writeUpdates(content: string, updates: Update[]): string {
20 updates.sort((a, b) => b.offset - a.offset);
21 updates.forEach(update => (content = update.updateFn(content)));
22 return content;
23}

Callers 1

index.spec.tsFile · 0.85

Calls 1

sortMethod · 0.65

Tested by

no test coverage detected