@actual-app/api 25.12.0-nightly.20251120 → 25.12.0-nightly.20251122

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.
@@ -12643,7 +12643,7 @@ proto.SyncResponse.prototype.setMerkle = function (value) {
12643
12643
  };
12644
12644
  goog.object.extend(exports, proto);
12645
12645
  function emptyTrie() {
12646
- return createTrieNode({ hash: 0 });
12646
+ return { hash: 0 };
12647
12647
  }
12648
12648
  function isNumberTrieNodeKey(input) {
12649
12649
  return ["0", "1", "2"].includes(input);
@@ -12651,22 +12651,6 @@ function isNumberTrieNodeKey(input) {
12651
12651
  function getKeys(trie) {
12652
12652
  return Object.keys(trie).filter(isNumberTrieNodeKey);
12653
12653
  }
12654
- function createTrieNode(props = {}) {
12655
- const result = {};
12656
- if (props["0"] !== void 0) {
12657
- result["0"] = props["0"];
12658
- }
12659
- if (props["1"] !== void 0) {
12660
- result["1"] = props["1"];
12661
- }
12662
- if (props["2"] !== void 0) {
12663
- result["2"] = props["2"];
12664
- }
12665
- if (props.hash !== void 0) {
12666
- result.hash = props.hash;
12667
- }
12668
- return result;
12669
- }
12670
12654
  function keyToTimestamp(key) {
12671
12655
  const fullkey = key + "0".repeat(16 - key.length);
12672
12656
  return parseInt(fullkey, 3) * 1e3 * 60;
@@ -12674,12 +12658,7 @@ function keyToTimestamp(key) {
12674
12658
  function insert$1(trie, timestamp) {
12675
12659
  const hash = timestamp.hash();
12676
12660
  const key = Number(Math.floor(timestamp.millis() / 1e3 / 60)).toString(3);
12677
- trie = createTrieNode({
12678
- "0": trie["0"],
12679
- "1": trie["1"],
12680
- "2": trie["2"],
12681
- hash: (trie.hash || 0) ^ hash
12682
- });
12661
+ trie = Object.assign({}, trie, { hash: (trie.hash || 0) ^ hash });
12683
12662
  return insertKey(trie, key, hash);
12684
12663
  }
12685
12664
  function insertKey(trie, key, hash) {
@@ -12689,18 +12668,10 @@ function insertKey(trie, key, hash) {
12689
12668
  const c = key[0];
12690
12669
  const t2 = isNumberTrieNodeKey(c) ? trie[c] : void 0;
12691
12670
  const n = t2 || {};
12692
- const childWithInserted = insertKey(n, key.slice(1), hash);
12693
- const updatedChild = createTrieNode({
12694
- "0": childWithInserted["0"],
12695
- "1": childWithInserted["1"],
12696
- "2": childWithInserted["2"],
12697
- hash: (n.hash || 0) ^ hash
12698
- });
12699
- return createTrieNode({
12700
- "0": c === "0" ? updatedChild : trie["0"],
12701
- "1": c === "1" ? updatedChild : trie["1"],
12702
- "2": c === "2" ? updatedChild : trie["2"],
12703
- hash: trie.hash
12671
+ return Object.assign({}, trie, {
12672
+ [c]: Object.assign({}, n, insertKey(n, key.slice(1), hash), {
12673
+ hash: (n.hash || 0) ^ hash
12674
+ })
12704
12675
  });
12705
12676
  }
12706
12677
  function diff(trie1, trie2) {
@@ -12742,20 +12713,15 @@ function prune(trie, n = 2) {
12742
12713
  }
12743
12714
  const keys2 = getKeys(trie);
12744
12715
  keys2.sort();
12745
- const prunedChildren = {};
12716
+ const next = { hash: trie.hash };
12746
12717
  for (const k of keys2.slice(-n)) {
12747
12718
  const node2 = trie[k];
12748
12719
  if (!node2) {
12749
12720
  throw new Error(`TrieNode for key ${k} could not be found`);
12750
12721
  }
12751
- prunedChildren[k] = prune(node2, n);
12722
+ next[k] = prune(node2, n);
12752
12723
  }
12753
- return createTrieNode({
12754
- "0": prunedChildren["0"],
12755
- "1": prunedChildren["1"],
12756
- "2": prunedChildren["2"],
12757
- hash: trie.hash
12758
- });
12724
+ return next;
12759
12725
  }
12760
12726
  var murmurhash$1 = { exports: {} };
12761
12727
  var hasRequiredMurmurhash;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actual-app/api",
3
- "version": "25.12.0-nightly.20251120",
3
+ "version": "25.12.0-nightly.20251122",
4
4
  "license": "MIT",
5
5
  "description": "An API for Actual",
6
6
  "engines": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actual-app/api",
3
- "version": "25.12.0-nightly.20251120",
3
+ "version": "25.12.0-nightly.20251122",
4
4
  "license": "MIT",
5
5
  "description": "An API for Actual",
6
6
  "engines": {