MCPcopy Create free account
hub / github.com/nodejs/node / processEvent

Method processEvent

deps/undici/undici.js:16582–16599  ·  view source on GitHub ↗

* @param {EventSourceStreamEvent} event

(event)

Source from the content-addressed store, hash-verified

16580 * @param {EventSourceStreamEvent} event
16581 */
16582 processEvent(event) {
16583 if (event.retry && isASCIINumber(event.retry)) {
16584 this.state.reconnectionTime = parseInt(event.retry, 10);
16585 }
16586 if (event.id !== void 0 && isValidLastEventId(event.id)) {
16587 this.state.lastEventId = event.id;
16588 }
16589 if (event.data !== void 0) {
16590 this.push({
16591 type: event.event || "message",
16592 options: {
16593 data: event.data,
16594 lastEventId: this.state.lastEventId,
16595 origin: this.state.origin
16596 }
16597 });
16598 }
16599 }
16600 clearEvent() {
16601 this.event.data = void 0;
16602 this.event.event = void 0;

Callers 1

_transformMethod · 0.45

Calls 3

isASCIINumberFunction · 0.70
isValidLastEventIdFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected