Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Object.values(this.tool.getRegisteredPlugins()).forEach(type => {
const { contract, singularName, pluralName } = type!;
this.debug('Generating %s blueprint', color.pluginName(singularName));
// prettier-ignore
pluginsBlueprint[pluralName] = array(union>([
string().notEmpty(),
shape({ [singularName]: string().notEmpty() }),
instance(contract, true),
], []));
});
Object.values(this.tool.getRegisteredPlugins()).forEach(type => {
const { contract, singularName, pluralName } = type!;
this.debug('Generating %s blueprint', chalk.magenta(singularName));
// prettier-ignore
pluginsBlueprint[pluralName] = array(union>([
string().notEmpty(),
shape({ [singularName]: string().notEmpty() }),
instance(contract as Constructor, true),
], []));
});
createUnionType(defaultValue: unknown = null): UnionBuilder {
return union(
[
string().notEmpty(),
shape({
type: string()
.notEmpty()
.required(),
}),
],
defaultValue,
).required();
}