915d1f909baa601dbe361af5836c2f69b0c12f695f1c367c742184da05b007305ecc9982c05a180931ddbc65a4e65d3416c391aa4f0877b2340d3b48b0ce2d 749 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. "use strict";
  2. Object.defineProperty(exports, "t", {
  3. value: true
  4. });
  5. exports.default = void 0;
  6. var _ContainerBase = require("../ContainerBase");
  7. class Stack extends _ContainerBase.Base {
  8. constructor(t = []) {
  9. super();
  10. this.S = [];
  11. const s = this;
  12. t.forEach((function(t) {
  13. s.push(t);
  14. }));
  15. }
  16. clear() {
  17. this.i = 0;
  18. this.S = [];
  19. }
  20. push(t) {
  21. this.S.push(t);
  22. this.i += 1;
  23. return this.i;
  24. }
  25. pop() {
  26. if (this.i === 0) return;
  27. this.i -= 1;
  28. return this.S.pop();
  29. }
  30. top() {
  31. return this.S[this.i - 1];
  32. }
  33. }
  34. var _default = Stack;
  35. exports.default = _default;
  36. //# sourceMappingURL=Stack.js.map