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

Method trimStart

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

Source from the content-addressed store, hash-verified

1026 return this.trimStart(charType).trimEnd(charType);
1027 }
1028 trimStart(charType) {
1029 const rx = new RegExp('^' + (charType || '\\s') + '+');
1030 this.intro = this.intro.replace(rx, '');
1031 if (!this.intro) {
1032 let source;
1033 let i = 0;
1034 do {
1035 source = this.sources[i++];
1036 if (!source) {
1037 break;
1038 }
1039 } while (!source.content.trimStartAborted(charType));
1040 }
1041 return this;
1042 }
1043 trimEnd(charType) {
1044 const rx = new RegExp((charType || '\\s') + '+$');
1045 let source;

Callers 1

trimMethod · 0.95

Calls 2

replaceMethod · 0.45
trimStartAbortedMethod · 0.45

Tested by

no test coverage detected