@dra2020/baseclient 1.0.19 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8826,21 +8826,31 @@ __exportStar(__webpack_require__(/*! ./bintrie */ "./lib/util/bintrie.ts"), expo
8826
8826
  /*!*****************************!*\
8827
8827
  !*** ./lib/util/bintrie.ts ***!
8828
8828
  \*****************************/
8829
- /***/ ((__unused_webpack_module, exports) => {
8829
+ /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
8830
8830
 
8831
8831
 
8832
- //
8833
- // Packed format Trie for mapping string to string
8834
- // Assumptions:
8835
- // 1. Lots of duplicate prefix strings in keys (so branching in trie happens late).
8836
- // 2. Lots of duplicate prefix strings in values.
8837
- // 3. Lots of keys with duplicate prefix map to the same string value.
8838
- // Especially good for something like our blockmapping.json file since both the keys (blockIDs)
8839
- // and values (precinct IDs) have a ton of redundancy and ~250 avg keys (blockID) map to same
8840
- // precinctID.
8841
- // The packed structure is just read directly into memory and walked in packed format.
8832
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8833
+ if (k2 === undefined) k2 = k;
8834
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
8835
+ }) : (function(o, m, k, k2) {
8836
+ if (k2 === undefined) k2 = k;
8837
+ o[k2] = m[k];
8838
+ }));
8839
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
8840
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
8841
+ }) : function(o, v) {
8842
+ o["default"] = v;
8843
+ });
8844
+ var __importStar = (this && this.__importStar) || function (mod) {
8845
+ if (mod && mod.__esModule) return mod;
8846
+ var result = {};
8847
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
8848
+ __setModuleDefault(result, mod);
8849
+ return result;
8850
+ };
8842
8851
  Object.defineProperty(exports, "__esModule", ({ value: true }));
8843
8852
  exports.BinTrieBuilder = exports.BinTrie = exports.u82s = exports.s2u8 = void 0;
8853
+ const U = __importStar(__webpack_require__(/*! ./util */ "./lib/util/util.ts"));
8844
8854
  /*
8845
8855
  -- For Node
8846
8856
  import * as u from 'util';
@@ -9052,9 +9062,11 @@ class BinTrie {
9052
9062
  }
9053
9063
  }
9054
9064
  exports.BinTrie = BinTrie;
9065
+ let DefaultOptions = { dedup: true };
9055
9066
  class BinTrieBuilder {
9056
- constructor(coder) {
9067
+ constructor(coder, options) {
9057
9068
  this.coder = coder;
9069
+ this.options = U.shallowAssignImmutable(DefaultOptions, options);
9058
9070
  }
9059
9071
  // Building
9060
9072
  nodeCount(node) {
@@ -9203,8 +9215,8 @@ class BinTrieBuilder {
9203
9215
  this.u8[k] = u8[j];
9204
9216
  }
9205
9217
  // Building
9206
- static fromMap(coder, o) {
9207
- let btb = new BinTrieBuilder(coder);
9218
+ static fromMap(coder, o, options) {
9219
+ let btb = new BinTrieBuilder(coder, options);
9208
9220
  btb.vtb = ValueTableBuilder.fromStrings(coder, Object.values(o));
9209
9221
  btb.vt = ValueTable.fromBuffer(coder, btb.vtb.ab, 0, btb.vtb.ab.byteLength);
9210
9222
  let keys = Object.keys(o);
@@ -9219,7 +9231,8 @@ class BinTrieBuilder {
9219
9231
  }
9220
9232
  });
9221
9233
  // dedup (collapse branches pointing to same value)
9222
- btb.dedup(btb.root);
9234
+ if (btb.options.dedup)
9235
+ btb.dedup(btb.root);
9223
9236
  // validate
9224
9237
  keys.forEach(k => {
9225
9238
  if (good && btb.getUnpacked(k) !== o[k]) {