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

Method isEmpty

src/MagicString.ts:989–1002  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

987 * Returns true if the resulting source is empty (disregarding white space).
988 */
989 isEmpty(): boolean {
990 let chunk: Chunk | null = this.firstChunk
991 while (chunk) {
992 if (
993 (chunk.intro.length && chunk.intro.trim())
994 || (chunk.content.length && chunk.content.trim())
995 || (chunk.outro.length && chunk.outro.trim())
996 ) {
997 return false
998 }
999 chunk = chunk.next
1000 }
1001 return true
1002 }
1003
1004 length(): number {
1005 let chunk: Chunk | null = this.firstChunk

Callers

nothing calls this directly

Calls 1

trimMethod · 0.45

Tested by

no test coverage detected