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

Method trimEnd

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

Source from the content-addressed store, hash-verified

279 }
280
281 trimEnd(charType) {
282 const rx = new RegExp((charType || '\\s') + '+$');
283
284 let source;
285 let i = this.sources.length - 1;
286
287 do {
288 source = this.sources[i--];
289 if (!source) {
290 this.intro = this.intro.replace(rx, '');
291 break;
292 }
293 } while (!source.content.trimEndAborted(charType));
294
295 return this;
296 }
297}

Callers 1

trimMethod · 0.45

Calls 2

replaceMethod · 0.45
trimEndAbortedMethod · 0.45

Tested by

no test coverage detected