Dashboard sipadu mbip
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

SimpleSet.js 572B

123456789101112131415161718192021222324252627282930313233
  1. var SimpleSet =
  2. /*#__PURE__*/
  3. function () {
  4. function SimpleSet() {
  5. this.v = [];
  6. }
  7. var _proto = SimpleSet.prototype;
  8. _proto.clear = function clear() {
  9. this.v.length = 0;
  10. };
  11. _proto.has = function has(k) {
  12. return this.v.indexOf(k) !== -1;
  13. };
  14. _proto.add = function add(k) {
  15. if (this.has(k)) return;
  16. this.v.push(k);
  17. };
  18. _proto.delete = function _delete(k) {
  19. var idx = this.v.indexOf(k);
  20. if (idx === -1) return false;
  21. this.v.splice(idx, 1);
  22. return true;
  23. };
  24. return SimpleSet;
  25. }();
  26. export { SimpleSet as default };