a zip code crypto-currency system good for red ONLY

Set.js 719B

123456789101112131415161718192021222324252627
  1. import { root } from './root';
  2. export function minimalSetImpl() {
  3. // THIS IS NOT a full impl of Set, this is just the minimum
  4. // bits of functionality we need for this library.
  5. return class MinimalSet {
  6. constructor() {
  7. this._values = [];
  8. }
  9. add(value) {
  10. if (!this.has(value)) {
  11. this._values.push(value);
  12. }
  13. }
  14. has(value) {
  15. return this._values.indexOf(value) !== -1;
  16. }
  17. get size() {
  18. return this._values.length;
  19. }
  20. clear() {
  21. this._values.length = 0;
  22. }
  23. }
  24. ;
  25. }
  26. export const Set = root.Set || minimalSetImpl();
  27. //# sourceMappingURL=Set.js.map