Skip to content

Commit 570512f

Browse files
committed
use the hasAttribute helper
1 parent 81dec88 commit 570512f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/schema/src/language-server/validator/attribute-application-validator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ function assignableToAttributeParam(arg: AttributeArg, param: AttributeParam, at
268268
// ContextType is inferred from the attribute's container's type
269269
if (isDataModelField(attr.$container)) {
270270
// If the field is Typed JSON, and the param is @default, the argument must be a string
271-
const dstIsTypedJson = attr.$container.attributes.find((attr) => attr.decl.ref?.name === '@json');
271+
const dstIsTypedJson = hasAttribute(attr.$container, '@json');
272272
if (dstIsTypedJson && param.default) {
273273
return argResolvedType.decl === 'String';
274274
}

0 commit comments

Comments
 (0)