Add validation to api

This commit is contained in:
Akim Mamedov
2023-11-16 22:58:59 +07:00
parent 20edd89456
commit 2641379167
2 changed files with 103 additions and 28 deletions

View File

@ -169,14 +169,16 @@ export const v5_registerService = (
);
return;
} else if (args.length === 2) {
}
if (args.length === 2) {
if (args[0] instanceof FluencePeer) {
v5_registerService([args[0], getDefaultServiceId(def), args[1]], def);
return;
} else {
v5_registerService([getDefaultPeer(), args[0], args[1]], def);
return;
}
v5_registerService([getDefaultPeer(), args[0], args[1]], def);
return;
}
const [peer, serviceId, serviceImpl] = args;