MCPcopy Create free account
hub / github.com/Rich-Harris/magic-string / reset

Method reset

tests/fuzz/edit-model.ts:107–119  ·  view source on GitHub ↗
(start: number, end: number)

Source from the content-addressed store, hash-verified

105 }
106
107 reset(start: number, end: number): void {
108 if (start === end)
109 return
110 this.assertOrdered(start, end)
111 this.split(start)
112 this.split(end)
113 for (let c = start; c < end; c++) {
114 this.text[c] = this.original[c]
115 this.edited[c] = false
116 this.holderEnd[c] = -1
117 }
118 this.clearEdgeInserts(start, end)
119 }
120
121 toString(): string {
122 return this.left[0] + this.between(0, this.original.length) + this.right[this.original.length]

Callers 6

slice.test.tsFile · 0.45
reset.test.tsFile · 0.45
replace.test.tsFile · 0.45
misc.test.tsFile · 0.45

Calls 3

assertOrderedMethod · 0.95
splitMethod · 0.95
clearEdgeInsertsMethod · 0.95

Tested by

no test coverage detected