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

Class g

benchmark/data-min.js:13–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11 }
12}
13class g {
14 constructor(t, e, n) {
15 ((this.start = t),
16 (this.end = e),
17 (this.original = n),
18 (this.intro = ''),
19 (this.outro = ''),
20 (this.content = n),
21 (this.storeName = !1),
22 (this.edited = !1),
23 Object.defineProperties(this, {
24 previous: { writable: !0, value: null },
25 next: { writable: !0, value: null },
26 }));
27 }
28 appendLeft(t) {
29 this.outro += t;
30 }
31 appendRight(t) {
32 this.intro = this.intro + t;
33 }
34 clone() {
35 const t = new g(this.start, this.end, this.original);
36 return (
37 (t.intro = this.intro),
38 (t.outro = this.outro),
39 (t.content = this.content),
40 (t.storeName = this.storeName),
41 (t.edited = this.edited),
42 t
43 );
44 }
45 contains(t) {
46 return this.start < t && t < this.end;
47 }
48 eachNext(t) {
49 let e = this;
50 for (; e; ) (t(e), (e = e.next));
51 }
52 eachPrevious(t) {
53 let e = this;
54 for (; e; ) (t(e), (e = e.previous));
55 }
56 edit(t, e, n) {
57 return (
58 (this.content = t),
59 n || ((this.intro = ''), (this.outro = '')),
60 (this.storeName = e),
61 (this.edited = !0),
62 this
63 );
64 }
65 prependLeft(t) {
66 this.outro = t + this.outro;
67 }
68 prependRight(t) {
69 this.intro = t + this.intro;
70 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected