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

Method remove

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

Source from the content-addressed store, hash-verified

68 }
69
70 remove(start: number, end: number): void {
71 if (start === end)
72 return
73 this.assertOrdered(start, end)
74 this.split(start)
75 this.split(end)
76 this.empty(start, end)
77 for (let i = start + 1; i < end; i++) {
78 this.left[i] = ''
79 this.right[i] = ''
80 }
81 }
82
83 update(start: number, end: number, content: string, options?: { overwrite?: boolean }): void {
84 if (start === end)

Callers 15

update.test.tsFile · 0.45
slice.test.tsFile · 0.45
reset.test.tsFile · 0.45
replace.test.tsFile · 0.45
misc.test.tsFile · 0.45
indent.test.tsFile · 0.45
removedFunction · 0.45
createFunction · 0.45
overwrite.test.tsFile · 0.45
trim.test.tsFile · 0.45

Calls 3

assertOrderedMethod · 0.95
splitMethod · 0.95
emptyMethod · 0.95

Tested by 2

removedFunction · 0.36
createFunction · 0.36