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

Method trim

src/MagicString.ts:1041–1043  ·  view source on GitHub ↗

* Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start and end.

(charType?: string)

Source from the content-addressed store, hash-verified

1039 * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start and end.
1040 */
1041 trim(charType?: string): this {
1042 return this.trimStart(charType).trimEnd(charType)
1043 }
1044
1045 /** @internal */
1046 trimEndAborted(charType?: string): boolean {

Callers 2

trimLinesMethod · 0.95
isEmptyMethod · 0.45

Calls 2

trimStartMethod · 0.95
trimEndMethod · 0.45

Tested by

no test coverage detected