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

Method length

src/MagicString.ts:1060–1068  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1058 }
1059
1060 length(): number {
1061 let chunk: Chunk | null = this.firstChunk
1062 let length = 0
1063 while (chunk) {
1064 length += chunk.intro.length + chunk.content.length + chunk.outro.length
1065 chunk = chunk.next
1066 }
1067 return length
1068 }
1069
1070 /**
1071 * Removes empty lines from the start and end.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected