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

Method indentAt

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

_splitChunkMethod · 0.95
prependRightMethod · 0.45

Tested by

no test coverage detected