Skip to content

Commit 279d57e

Browse files
committed
fix
1 parent e2091be commit 279d57e

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

packages/compiler/src/lib/decorators.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -874,15 +874,11 @@ export const $withPickedProperties: WithPickedPropertiesDecorator = (
874874
filterModelPropertiesInPlace(target, (prop) => pickedNames.has(prop.name));
875875
};
876876

877-
function validatePropertyName(
878-
context: DecoratorContext,
879-
target: Model,
880-
name: string
881-
) {
877+
function validatePropertyName(context: DecoratorContext, target: Model, name: string) {
882878
const source = target.templateMapper?.args[0] as Model;
883879
if (source && !source.properties?.has(name)) {
884880
reportDiagnostic(context.program, {
885-
code:"unexpected-property",
881+
code: "unexpected-property",
886882
format: {
887883
propertyName: name,
888884
type: getTypeName(source),
@@ -892,7 +888,6 @@ function validatePropertyName(
892888
}
893889
}
894890

895-
896891
// -- @withoutDefaultValues decorator ----------------------
897892

898893
export const $withoutDefaultValues: WithoutDefaultValuesDecorator = (

packages/compiler/test/decorators/decorators.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,8 @@ describe("compiler: built-in decorators", () => {
886886
expectDiagnostics(diagnostics, [
887887
{
888888
code: "unexpected-property",
889-
message: "Object value may only specify known properties, and 'notMee' does not exist in type 'OriginalModel'.",
889+
message:
890+
"Object value may only specify known properties, and 'notMee' does not exist in type 'OriginalModel'.",
890891
},
891892
]);
892893
});

0 commit comments

Comments
 (0)