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

Method length

src/MagicString.ts:1004–1012  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1002 }
1003
1004 length(): number {
1005 let chunk: Chunk | null = this.firstChunk
1006 let length = 0
1007 while (chunk) {
1008 length += chunk.intro.length + chunk.content.length + chunk.outro.length
1009 chunk = chunk.next
1010 }
1011 return length
1012 }
1013
1014 /**
1015 * Removes empty lines from the start and end.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected