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

Method isEmpty

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

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

()

Source from the content-addressed store, hash-verified

1043 * Returns true if the resulting source is empty (disregarding white space).
1044 */
1045 isEmpty(): boolean {
1046 let chunk: Chunk | null = this.firstChunk
1047 while (chunk) {
1048 if (
1049 (chunk.intro.length && chunk.intro.trim())
1050 || (chunk.content.length && chunk.content.trim())
1051 || (chunk.outro.length && chunk.outro.trim())
1052 ) {
1053 return false
1054 }
1055 chunk = chunk.next
1056 }
1057 return true
1058 }
1059
1060 length(): number {
1061 let chunk: Chunk | null = this.firstChunk

Callers

nothing calls this directly

Calls 1

trimMethod · 0.45

Tested by

no test coverage detected