This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on https://gist.github.com/thomas-lowry/4d2d890ae5dfd4ab4eccebc4da99d52d with added return safety | |
const getPage = (node) => { | |
let item = node; | |
while (item && item.type !== "PAGE") { | |
item = item.parent; | |
} | |
// Return item if it's a PAGE node, otherwise return an empty string | |
return item?.type === "PAGE" ? item : ""; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
device | part | |
---|---|---|
0 | 178 | |
0 | 179 | |
0 | 182 | |
0 | 196 | |
0 | 197 | |
0 | 199 | |
0 | 211 | |
0 | 218 | |
0 | 219 |