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

Method trimStart

src/Bundle.js:262–279  ·  view source on GitHub ↗
(charType)

Source from the content-addressed store, hash-verified

260 }
261
262 trimStart(charType) {
263 const rx = new RegExp('^' + (charType || '\\s') + '+');
264 this.intro = this.intro.replace(rx, '');
265
266 if (!this.intro) {
267 let source;
268 let i = 0;
269
270 do {
271 source = this.sources[i++];
272 if (!source) {
273 break;
274 }
275 } while (!source.content.trimStartAborted(charType));
276 }
277
278 return this;
279 }
280
281 trimEnd(charType) {
282 const rx = new RegExp((charType || '\\s') + '+$');

Callers 1

trimMethod · 0.95

Calls 2

replaceMethod · 0.45
trimStartAbortedMethod · 0.45

Tested by

no test coverage detected