项目原始demo,不改动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 

31 lines
851 B

  1. "use strict";
  2. var FastMap = (function () {
  3. function FastMap() {
  4. this.values = {};
  5. }
  6. FastMap.prototype.delete = function (key) {
  7. this.values[key] = null;
  8. return true;
  9. };
  10. FastMap.prototype.set = function (key, value) {
  11. this.values[key] = value;
  12. return this;
  13. };
  14. FastMap.prototype.get = function (key) {
  15. return this.values[key];
  16. };
  17. FastMap.prototype.forEach = function (cb, thisArg) {
  18. var values = this.values;
  19. for (var key in values) {
  20. if (values.hasOwnProperty(key) && values[key] !== null) {
  21. cb.call(thisArg, values[key], key);
  22. }
  23. }
  24. };
  25. FastMap.prototype.clear = function () {
  26. this.values = {};
  27. };
  28. return FastMap;
  29. }());
  30. exports.FastMap = FastMap;
  31. //# sourceMappingURL=FastMap.js.map