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

Method trimEnd

benchmark/data.js:1043–1055  ·  view source on GitHub ↗
(charType)

Source from the content-addressed store, hash-verified

1041 return this;
1042 }
1043 trimEnd(charType) {
1044 const rx = new RegExp((charType || '\\s') + '+$');
1045 let source;
1046 let i = this.sources.length - 1;
1047 do {
1048 source = this.sources[i--];
1049 if (!source) {
1050 this.intro = this.intro.replace(rx, '');
1051 break;
1052 }
1053 } while (!source.content.trimEndAborted(charType));
1054 return this;
1055 }
1056}
1057export { Bundle, SourceMap, MagicString as default };

Callers

nothing calls this directly

Calls 2

replaceMethod · 0.45
trimEndAbortedMethod · 0.45

Tested by

no test coverage detected