DequeIterator.js 400 B

1234567891011121314151617181920
  1. "use strict";
  2. const DoublyLinkedListIterator = require("./DoublyLinkedListIterator");
  3. /**
  4. * Thin wrapper around an underlying DDL iterator
  5. */
  6. class DequeIterator extends DoublyLinkedListIterator {
  7. next() {
  8. const result = super.next();
  9. // unwrap the node...
  10. if (result.value) {
  11. result.value = result.value.data;
  12. }
  13. return result;
  14. }
  15. }
  16. module.exports = DequeIterator;