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

Method isEmpty

src/MagicString.ts:1037–1050  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

1035 * Returns true if the resulting source is empty (disregarding white space).
1036 */
1037 isEmpty(): boolean {
1038 let chunk: Chunk | null = this.firstChunk
1039 while (chunk) {
1040 if (
1041 (chunk.intro.length && chunk.intro.trim())
1042 || (chunk.content.length && chunk.content.trim())
1043 || (chunk.outro.length && chunk.outro.trim())
1044 ) {
1045 return false
1046 }
1047 chunk = chunk.next
1048 }
1049 return true
1050 }
1051
1052 length(): number {
1053 let chunk: Chunk | null = this.firstChunk

Callers

nothing calls this directly

Calls 1

trimMethod · 0.45

Tested by

no test coverage detected