Skip to content

Commit ac26f36

Browse files
sdobzpieh
authored andcommitted
fix: Align types of rootNodeMap during root node tracking (#39262)
* fix(gatsby): change ids in findRootNodeAncestor from array to set (#39261) * Update packages/gatsby/src/schema/node-model.js Co-authored-by: Michal Piechowiak <[email protected]> * chore: fix lint --------- Co-authored-by: sdobz <[email protected]> Co-authored-by: Michal Piechowiak <[email protected]> (cherry picked from commit 1825669)
1 parent 08137dc commit ac26f36

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/gatsby/src/schema/node-model.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,10 @@ class LocalNodeModel {
521521
let iterations = 0
522522
let ids = this._rootNodeMap.get(obj)
523523
if (!ids) {
524-
ids = []
524+
ids = new Set()
525525
}
526-
if (obj?.parent) {
527-
ids.push(obj.parent)
526+
if (obj?.parent && typeof obj.parent === `string`) {
527+
ids.add(obj.parent)
528528
}
529529
let matchingRoot = null
530530

0 commit comments

Comments
 (0)