Compiler support: fix issue with incorrect check for missing fields in service registration (#90)

This commit is contained in:
Pavel 2021-10-20 23:03:06 +03:00 committed by GitHub
parent fe52648103
commit 9d00b70897
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -339,7 +339,7 @@ export function registerService(args: any[], def: ServiceDef) {
// Checking for missing keys
const requiredKeys = def.functions.map((x) => x.functionName);
const incorrectServiceDefinitions = Object.keys(service).filter((f) => !(f in requiredKeys));
const incorrectServiceDefinitions = requiredKeys.filter((f) => !(f in service));
if (!!incorrectServiceDefinitions.length) {
throw new Error(
`Error registering service ${serviceId}: missing functions: ` +