MCPcopy Index your code
hub / github.com/fb55/htmlparser2 / getPromiseEventCollector

Function getPromiseEventCollector

src/WebWritableStream.spec.ts:82–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

80});
81
82function getPromiseEventCollector(): [
83 handler: Partial<Handler>,
84 promise: Promise<unknown>,
85] {
86 let handler: Partial<Handler> | undefined;
87 const promise = new Promise<unknown>((resolve, reject) => {
88 handler = helper.getEventCollector((error, events) => {
89 if (error) {
90 reject(error);
91 } else {
92 resolve(events);
93 }
94 });
95 });
96
97 if (!handler) {
98 throw new Error("Failed to initialize event handler");
99 }
100
101 return [handler, promise];
102}
103
104async function testStream(
105 file: string,

Callers 1

testStreamFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…