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

Method constructor

tests/fuzz/edit-model.ts:23–32  ·  view source on GitHub ↗
(original: string)

Source from the content-addressed store, hash-verified

21 boundaries: Set<number>
22
23 constructor(original: string) {
24 const n = original.length
25 this.original = original
26 this.text = [...original]
27 this.edited = Array.from<boolean>({ length: n }).fill(false)
28 this.holderEnd = Array.from<number>({ length: n }).fill(-1)
29 this.left = Array.from<string>({ length: n + 1 }).fill('')
30 this.right = Array.from<string>({ length: n + 1 }).fill('')
31 this.boundaries = new Set([0, n])
32 }
33
34 split(index: number): void {
35 if (this.boundaries.has(index))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected