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

Method indentAt

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

_splitChunkMethod · 0.95
prependRightMethod · 0.45

Tested by

no test coverage detected