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

Method constructor

src/Chunk.ts:15–38  ·  view source on GitHub ↗
(start: number, end: number, content: string)

Source from the content-addressed store, hash-verified

13 declare next: Chunk | null
14
15 constructor(start: number, end: number, content: string) {
16 this.start = start
17 this.end = end
18 this.original = content
19
20 this.intro = ''
21 this.outro = ''
22
23 this.content = content
24 this.storeName = false
25 this.edited = false
26
27 if (DEBUG) {
28 // we make these non-enumerable, for sanity while debugging
29 Object.defineProperties(this, {
30 previous: { writable: true, value: null },
31 next: { writable: true, value: null },
32 })
33 }
34 else {
35 this.previous = null
36 this.next = null
37 }
38 }
39
40 appendLeft(content: string): void {
41 this.outro += content

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected