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

Method isEmpty

src/MagicString.ts:1032–1045  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

trimMethod · 0.45

Tested by

no test coverage detected