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

Method indentAt

src/MagicString.ts:367–378  ·  view source on GitHub ↗
(index: number)

Source from the content-addressed store, hash-verified

365 let chunk = this.firstChunk
366
367 const indentAt = (index: number) => {
368 shouldIndentNextCharacter = false
369
370 if (index === chunk!.start) {
371 chunk!.prependRight(resolvedIndentStr)
372 }
373 else {
374 this._splitChunk(chunk!, index)
375 chunk = chunk!.next
376 chunk!.prependRight(resolvedIndentStr)
377 }
378 }
379
380 while (chunk) {
381 const end = chunk.end

Callers

nothing calls this directly

Calls 2

_splitChunkMethod · 0.95
prependRightMethod · 0.45

Tested by

no test coverage detected