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

Method write

src/Parser.ts:773–784  ·  view source on GitHub ↗

* Parses a chunk of data and calls the corresponding callbacks. * @param chunk Chunk to parse.

(chunk: string)

Source from the content-addressed store, hash-verified

771 * @param chunk Chunk to parse.
772 */
773 write(chunk: string): void {
774 if (this.ended) {
775 this.cbs.onerror?.(new Error(".write() after done!"));
776 return;
777 }
778
779 this.buffers.push(chunk);
780 if (this.tokenizer.running) {
781 this.tokenizer.write(chunk);
782 this.writeIndex++;
783 }
784 }
785
786 /**
787 * Parses the end of the buffer and clears the stack, calls onend.

Callers 10

runTestFunction · 0.95
endMethod · 0.95
_writeMethod · 0.45
Parser.spec.tsFile · 0.45
Tokenizer.spec.tsFile · 0.45
resumeMethod · 0.45
index.spec.tsFile · 0.45

Calls 1

onerrorMethod · 0.80

Tested by 1

runTestFunction · 0.76