Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return schemaRetriever.getFullMeta(kind).then((fullMeta) => {
var channels = fullMeta[channelType];
var choices = Object.keys(channels);
if (choices.length === 0) // no channels of this type for this schema, try again
return chooseInvocation(schemaRetriever, schemas, samplingPolicy, channelType);
var channelName = uniform(choices);
channels[channelName].schema = channels[channelName].schema.map((t) => Type.fromString(t));
var result = ThingTalkUtils.splitArgsForSchema(channels[channelName], channelType, true);
result.kind = kind;
result.name = channelName;
return result;
});
}