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

Method replacer

src/MagicString.ts:363–368  ·  view source on GitHub ↗
(match: string)

Source from the content-addressed store, hash-verified

361
362 let shouldIndentNextCharacter = options.indentStart !== false
363 const replacer = (match: string) => {
364 if (shouldIndentNextCharacter)
365 return `${resolvedIndentStr}${match}`
366 shouldIndentNextCharacter = true
367 return match
368 }
369
370 this.intro = this.intro.replace(pattern, replacer)
371

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected