mirror of
https://github.com/fluencelabs/fluence-js.git
synced 2025-04-25 09:52:12 +00:00
Compiler support: fix issue with incorrect check for missing fields in service registration (#90)
This commit is contained in:
parent
fe52648103
commit
9d00b70897
@ -339,7 +339,7 @@ export function registerService(args: any[], def: ServiceDef) {
|
|||||||
|
|
||||||
// Checking for missing keys
|
// Checking for missing keys
|
||||||
const requiredKeys = def.functions.map((x) => x.functionName);
|
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) {
|
if (!!incorrectServiceDefinitions.length) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Error registering service ${serviceId}: missing functions: ` +
|
`Error registering service ${serviceId}: missing functions: ` +
|
||||||
|
Loading…
x
Reference in New Issue
Block a user