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

Method indentAt

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

_splitChunkMethod · 0.95
prependRightMethod · 0.45

Tested by

no test coverage detected