MCPcopy Index your code
hub / github.com/nodejs/node / next

Method next

lib/internal/vfs/watcher.js:650–663  ·  view source on GitHub ↗

* Gets the next event. * @returns {Promise }

()

Source from the content-addressed store, hash-verified

648 * @returns {Promise<IteratorResult>}
649 */
650 next() {
651 if (this.#closed) {
652 return PromiseResolve({ done: true, value: undefined });
653 }
654
655 if (this.#pendingEvents.length > 0) {
656 const event = this.#pendingEvents.shift();
657 return PromiseResolve({ done: false, value: event });
658 }
659
660 return new Promise((resolve, reject) => {
661 ArrayPrototypePush(this.#pendingResolvers, { resolve, reject });
662 });
663 }
664
665 /**
666 * Closes the iterator and underlying watcher.

Callers

nothing calls this directly

Calls 1

shiftMethod · 0.45

Tested by

no test coverage detected