(o: Solid.Owner)
| 69 | const SOLID_REFRESH_PREFIX = '[solid-refresh]' |
| 70 | |
| 71 | export const getOwnerType = (o: Solid.Owner): NodeType => { |
| 72 | if (typeof o.sdtType !== 'undefined') return o.sdtType |
| 73 | if (!isSolidComputation(o)) { |
| 74 | if ('sources' in o) return NodeType.CatchError |
| 75 | return NodeType.Root |
| 76 | } |
| 77 | if (isSolidComponent(o)) return NodeType.Component |
| 78 | // memo |
| 79 | if ('comparator' in o) { |
| 80 | if ( |
| 81 | // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type |
| 82 | (o.owner as {component?: Function} | null)?.component?.name.startsWith( |
| 83 | SOLID_REFRESH_PREFIX, |
| 84 | ) |
| 85 | ) { |
| 86 | return NodeType.Refresh |
| 87 | } |
| 88 | return NodeType.Memo |
| 89 | } |
| 90 | // Effect |
| 91 | if (!o.pure) { |
| 92 | if (o.user === true) return NodeType.Effect |
| 93 | /* |
| 94 | after solid 1.8 context is being copied to children owners |
| 95 | so need to check if the reference is the same |
| 96 | */ |
| 97 | if (o.context !== null && (!o.owner || o.owner.context !== o.context)) |
| 98 | return NodeType.Context |
| 99 | return NodeType.Render |
| 100 | } |
| 101 | return NodeType.Computation |
| 102 | } |
| 103 | |
| 104 | export function getNode( |
| 105 | o: Solid.SourceMapValue | Solid.Signal | Solid.Owner | Solid.Store, |
no test coverage detected
searching dependent graphs…