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

Method trimStart

benchmark/data.js:115–130  ·  view source on GitHub ↗
(rx)

Source from the content-addressed store, hash-verified

113 }
114 }
115 trimStart(rx) {
116 this.intro = this.intro.replace(rx, '');
117 if (this.intro.length) return true;
118 const trimmed = this.content.replace(rx, '');
119 if (trimmed.length) {
120 if (trimmed !== this.content) {
121 this.split(this.end - trimmed.length);
122 this.edit('', void 0, true);
123 }
124 return true;
125 } else {
126 this.edit('', void 0, true);
127 this.outro = this.outro.replace(rx, '');
128 if (this.outro.length) return true;
129 }
130 }
131}
132let _btoa = () => {
133 throw new Error('Unsupported environment: `btoa` or `Buffer` should be supported.');

Callers 1

trimStartAbortedMethod · 0.45

Calls 3

splitMethod · 0.95
editMethod · 0.95
replaceMethod · 0.45

Tested by

no test coverage detected