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

Method lastChar

src/MagicString.js:557–567  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

555 }
556
557 lastChar() {
558 if (this.outro.length) return this.outro[this.outro.length - 1];
559 let chunk = this.lastChunk;
560 do {
561 if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];
562 if (chunk.content.length) return chunk.content[chunk.content.length - 1];
563 if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];
564 } while ((chunk = chunk.previous));
565 if (this.intro.length) return this.intro[this.intro.length - 1];
566 return '';
567 }
568
569 lastLine() {
570 let lineIndex = this.outro.lastIndexOf(n);

Callers 1

indentMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected