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

Method indentAt

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

Source from the content-addressed store, hash-verified

378 let chunk = this.firstChunk
379
380 const indentAt = (index: number) => {
381 shouldIndentNextCharacter = false
382
383 if (index === chunk!.start) {
384 chunk!.prependRight(resolvedIndentStr)
385 }
386 else {
387 this._splitChunk(chunk!, index)
388 chunk = chunk!.next
389 chunk!.prependRight(resolvedIndentStr)
390 }
391 }
392
393 while (chunk) {
394 const end = chunk.end

Callers

nothing calls this directly

Calls 2

_splitChunkMethod · 0.95
prependRightMethod · 0.45

Tested by

no test coverage detected