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

Method trimEnd

src/Bundle.ts:343–358  ·  view source on GitHub ↗
(charType?: string)

Source from the content-addressed store, hash-verified

341 }
342
343 trimEnd(charType?: string): this {
344 const rx = new RegExp(`${charType || '\\s'}+$`)
345
346 let source
347 let i = this.sources.length - 1
348
349 do {
350 source = this.sources[i--]
351 if (!source) {
352 this.intro = this.intro.replace(rx, '')
353 break
354 }
355 } while (!source.content.trimEndAborted(charType))
356
357 return this
358 }
359}

Callers 1

trimMethod · 0.45

Calls 2

replaceMethod · 0.45
trimEndAbortedMethod · 0.45

Tested by

no test coverage detected