MCPcopy
hub / github.com/fb55/htmlparser2 / end

Method end

src/Parser.ts:790–799  ·  view source on GitHub ↗

* Parses the end of the buffer and clears the stack, calls onend. * @param chunk Optional final chunk to parse.

(chunk?: string)

Source from the content-addressed store, hash-verified

788 * @param chunk Optional final chunk to parse.
789 */
790 end(chunk?: string): void {
791 if (this.ended) {
792 this.cbs.onerror?.(new Error(".end() after done!"));
793 return;
794 }
795
796 if (chunk) this.write(chunk);
797 this.ended = true;
798 this.tokenizer.end();
799 }
800
801 /**
802 * Pauses parsing. The parser won't emit events until `resume` is called.

Callers 12

runTestFunction · 0.95
parseCompleteMethod · 0.95
parseDocumentFunction · 0.45
_finalMethod · 0.45
closeMethod · 0.45
Parser.spec.tsFile · 0.45
Tokenizer.spec.tsFile · 0.45
resumeMethod · 0.45
testStreamFunction · 0.45
index.spec.tsFile · 0.45

Calls 2

writeMethod · 0.95
onerrorMethod · 0.80

Tested by 2

runTestFunction · 0.76
testStreamFunction · 0.36