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

Method trim

src/MagicString.ts:1258–1260  ·  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

1256 * Trims content matching `charType` (defaults to `\s`, i.e. whitespace) from the start and end.
1257 */
1258 trim(charType?: string): this {
1259 return this.trimStart(charType).trimEnd(charType)
1260 }
1261
1262 /** @internal */
1263 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