MCPcopy Create free account
hub / github.com/zenstackhq/zenstack / getContainingModel

Function getContainingModel

packages/sdk/src/model-utils.ts:120–125  ·  view source on GitHub ↗
(node: AstNode | undefined)

Source from the content-addressed store, hash-verified

118}
119
120export function getContainingModel(node: AstNode | undefined): Model | null {
121 if (!node) {
122 return null;
123 }
124 return isModel(node) ? node : getContainingModel(node.$container);
125}
126
127export function resolved<T extends AstNode>(ref: Reference<T>): T {
128 if (!ref.ref) {

Callers 1

isFromStdlibFunction · 0.85

Calls 1

isModelFunction · 0.90

Tested by

no test coverage detected