MCPcopy Index your code
hub / github.com/banga/git-split-diffs / apply

Function apply

src/SpannedString.test.ts:7–17  ·  view source on GitHub ↗
(string: SpannedString<string>)

Source from the content-addressed store, hash-verified

5}
6
7function apply(string: SpannedString<string>) {
8 return Array.from(string.iterSubstrings())
9 .map(([substring, tags]) => {
10 let s = substring;
11 for (const tag of tags) {
12 s = `<${tag}>${s}</${tag}>`;
13 }
14 return s;
15 })
16 .join('');
17}
18
19function format(string: string, spans: [number, number, string][]) {
20 const s = S().appendString(string);

Callers 2

formatFunction · 0.85

Calls 1

iterSubstringsMethod · 0.80

Tested by

no test coverage detected