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

Method replacer

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected