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

Method isEmpty

src/MagicString.ts:1006–1019  ·  view source on GitHub ↗

* Returns true if the resulting source is empty (disregarding white space).

()

Source from the content-addressed store, hash-verified

1004 * Returns true if the resulting source is empty (disregarding white space).
1005 */
1006 isEmpty(): boolean {
1007 let chunk: Chunk | null = this.firstChunk
1008 while (chunk) {
1009 if (
1010 (chunk.intro.length && chunk.intro.trim())
1011 || (chunk.content.length && chunk.content.trim())
1012 || (chunk.outro.length && chunk.outro.trim())
1013 ) {
1014 return false
1015 }
1016 chunk = chunk.next
1017 }
1018 return true
1019 }
1020
1021 length(): number {
1022 let chunk: Chunk | null = this.firstChunk

Callers

nothing calls this directly

Calls 1

trimMethod · 0.45

Tested by

no test coverage detected