MCPcopy Index your code
hub / github.com/zenstackhq/zenstack / hasAttribute

Function hasAttribute

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

Source from the content-addressed store, hash-verified

54 | AttributeParam;
55
56export function hasAttribute(decl: AttributeTarget, name: string) {
57 return !!getAttribute(decl, name);
58}
59
60export function getAttribute(decl: AttributeTarget, name: string) {
61 return (decl.attributes as (DataModelAttribute | DataFieldAttribute)[]).find((attr) => attr.decl.$refText === name);

Callers 12

validateFieldsMethod · 0.90
validateFieldMethod · 0.90
validateDelegateMapMethod · 0.90
addOrUpdateModelFunction · 0.90
isComputedFieldFunction · 0.70
isDelegateModelFunction · 0.70
getDataModelAndTypeDefsFunction · 0.70
getAuthDeclFunction · 0.70
getAllFieldsFunction · 0.70

Calls 1

getAttributeFunction · 0.70

Tested by

no test coverage detected