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

Function getAttribute

packages/language/src/utils.ts:60–62  ·  view source on GitHub ↗
(decl: AttributeTarget, name: string)

Source from the content-addressed store, hash-verified

58}
59
60export function getAttribute(decl: AttributeTarget, name: string) {
61 return (decl.attributes as (DataModelAttribute | DataFieldAttribute)[]).find((attr) => attr.decl.$refText === name);
62}
63
64export function isFromStdlib(node: AstNode) {
65 const model = AstUtils.getContainerOfType(node, isModel);

Callers 4

getCompletionFromHintMethod · 0.90
hasAttributeFunction · 0.70

Calls 1

findMethod · 0.80

Tested by

no test coverage detected