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.

index.js 1.3KB

1234567891011121314151617181920212223242526272829303132333435
  1. "use strict";
  2. var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
  3. if (k2 === undefined) k2 = k;
  4. var desc = Object.getOwnPropertyDescriptor(m, k);
  5. if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
  6. desc = { enumerable: true, get: function() { return m[k]; } };
  7. }
  8. Object.defineProperty(o, k2, desc);
  9. }) : (function(o, m, k, k2) {
  10. if (k2 === undefined) k2 = k;
  11. o[k2] = m[k];
  12. }));
  13. var __exportStar = (this && this.__exportStar) || function(m, exports) {
  14. for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
  15. };
  16. var __importDefault = (this && this.__importDefault) || function (mod) {
  17. return (mod && mod.__esModule) ? mod : { "default": mod };
  18. };
  19. Object.defineProperty(exports, "__esModule", { value: true });
  20. const InnerNode_1 = __importDefault(require("./InnerNode"));
  21. const LeafNode_1 = __importDefault(require("./LeafNode"));
  22. class SHAMap {
  23. constructor() {
  24. this.root = new InnerNode_1.default(0);
  25. }
  26. get hash() {
  27. return this.root.hash;
  28. }
  29. addItem(tag, data, type) {
  30. this.root.addItem(tag, new LeafNode_1.default(tag, data, type));
  31. }
  32. }
  33. __exportStar(require("./node"), exports);
  34. exports.default = SHAMap;
  35. //# sourceMappingURL=index.js.map