Simplified the parseEntityRef function
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
+2
-2
@@ -187,7 +187,7 @@ describe('BuiltinKindsEntityProcessor', () => {
|
||||
await expect(
|
||||
processor.postProcessEntity(entity, location, emit),
|
||||
).rejects.toThrowError(
|
||||
'Entity reference "r" did not specify a kind (e.g. starting with "Component:"), and has no default',
|
||||
'Entity reference "r" had missing or empty kind (e.g. did not start with "component:" or similar)',
|
||||
);
|
||||
});
|
||||
|
||||
@@ -360,7 +360,7 @@ describe('BuiltinKindsEntityProcessor', () => {
|
||||
await expect(
|
||||
processor.postProcessEntity(entity, location, emit),
|
||||
).rejects.toThrowError(
|
||||
'Entity reference "c" did not specify a kind (e.g. starting with "Component:"), and has no default',
|
||||
'Entity reference "c" had missing or empty kind (e.g. did not start with "component:" or similar)',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -106,11 +106,6 @@ export class BuiltinKindsEntityProcessor implements CatalogProcessor {
|
||||
}
|
||||
for (const target of [targets].flat()) {
|
||||
const targetRef = parseEntityRef(target, context);
|
||||
if (targetRef.kind === undefined) {
|
||||
throw new Error(
|
||||
`Entity reference "${target}" did not specify a kind (e.g. starting with "Component:"), and has no default`,
|
||||
);
|
||||
}
|
||||
emit(
|
||||
result.relation({
|
||||
source: selfRef,
|
||||
|
||||
Reference in New Issue
Block a user