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

Method isEmpty

src/MagicString.ts:990–1003  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

trimMethod · 0.45

Tested by

no test coverage detected