List.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. "use strict";
  2. var __read = (this && this.__read) || function (o, n) {
  3. var m = typeof Symbol === "function" && o[Symbol.iterator];
  4. if (!m) return o;
  5. var i = m.call(o), r, ar = [], e;
  6. try {
  7. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  8. }
  9. catch (error) { e = { error: error }; }
  10. finally {
  11. try {
  12. if (r && !r.done && (m = i["return"])) m.call(i);
  13. }
  14. finally { if (e) throw e.error; }
  15. }
  16. return ar;
  17. };
  18. var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
  19. if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
  20. if (ar || !(i in from)) {
  21. if (!ar) ar = Array.prototype.slice.call(from, 0, i);
  22. ar[i] = from[i];
  23. }
  24. }
  25. return to.concat(ar || Array.prototype.slice.call(from));
  26. };
  27. Object.defineProperty(exports, "__esModule", { value: true });
  28. exports.LiteList = void 0;
  29. var LiteList = (function () {
  30. function LiteList(children) {
  31. this.nodes = [];
  32. this.nodes = __spreadArray([], __read(children), false);
  33. }
  34. LiteList.prototype.append = function (node) {
  35. this.nodes.push(node);
  36. };
  37. LiteList.prototype[Symbol.iterator] = function () {
  38. var i = 0;
  39. return {
  40. next: function () {
  41. return (i === this.nodes.length ?
  42. { value: null, done: true } :
  43. { value: this.nodes[i++], done: false });
  44. }
  45. };
  46. };
  47. return LiteList;
  48. }());
  49. exports.LiteList = LiteList;
  50. //# sourceMappingURL=List.js.map