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

Method replacer

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

Source from the content-addressed store, hash-verified

356
357 let shouldIndentNextCharacter = options.indentStart !== false
358 const replacer = (match: string) => {
359 if (shouldIndentNextCharacter)
360 return `${resolvedIndentStr}${match}`
361 shouldIndentNextCharacter = true
362 return match
363 }
364
365 this.intro = this.intro.replace(pattern, replacer)
366

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected