项目原始demo,不改动
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
Den här utvecklingskatalogen är arkiverad. Du kan se filer och klona katalogen, men inte öppna ärenden eller genomföra push- eller pull-förfrågningar.
 
 
 
 

31 rader
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