Jacky Zhao
2025-03-14 fbb452385325d4418ce53e61178fe2494255caf5
quartz/util/fileTrie.ts
@@ -89,6 +89,14 @@
    this.insert(file.slug.split("/"), file)
  }
  findNode(path: string[]): FileTrieNode<T> | undefined {
    if (path.length === 0 || (path.length === 1 && path[0] === "index")) {
      return this
    }
    return this.children.find((c) => c.slugSegment === path[0])?.findNode(path.slice(1))
  }
  /**
   * Filter trie nodes. Behaves similar to `Array.prototype.filter()`, but modifies tree in place
   */