Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static resolve(f: ParserField) {
let returnedValue = `${f.name}`;
if (f.data && f.data.type) {
if (f.data.type === Value.EnumValue) {
returnedValue = `${f.type.name}`;
}
if (f.data.type === Value.StringValue) {
returnedValue = `"${f.name}"`;
}
if (f.data.type === Value.ObjectValue) {
returnedValue = `{${(f.args || []).map(TemplateUtils.resolverForConnection)}}`;
}
}
return returnedValue;
}
}
.filter((d) => d.data && d.data.type === Value.StringValue)
.map(Utils.nodeDefinitionToAcceptedEditorNodeDefinition),
(n) => n.name.length === 0 && n.definition.data && (n.definition.data as any).type !== Value.StringValue,
);
.filter((d) => d.data && d.data.type === Value.StringValue)
.map(Utils.nodeDefinitionToAcceptedEditorNodeDefinition);
acceptsInputs: (d, defs) =>
defs
.filter((d) => d.data && d.data.type === valueType)
.concat(
Utils.dataForTypes(defs, [ValueDefinition.InputValueDefinition]).filter(
(d) => d.data && d.data.type !== Value.ObjectValue,
),
)
.map(Utils.nodeDefinitionToAcceptedEditorNodeDefinition),
},
];
return scalarDefinitions;
};
const BooleanDefintions = generateScalarDefinitions(ScalarTypes.Boolean, Value.BooleanValue, help.Boolean);
const FloatDefintions = generateScalarDefinitions(ScalarTypes.Float, Value.FloatValue, help.Float);
const IDDefintions = generateScalarDefinitions(ScalarTypes.ID, Value.StringValue, help.ID);
const IntDefinitions = generateScalarDefinitions(ScalarTypes.Int, Value.IntValue, help.Int);
const StringDefinitions = generateScalarDefinitions(ScalarTypes.String, Value.StringValue, help.String);
return [
...BooleanDefintions,
...FloatDefintions,
...[IDDefintions[0], IDDefintions[2]],
...IntDefinitions,
...StringDefinitions,
];
}
}
.filter((d) => d.data && d.data.type === Value.StringValue)
.map(Utils.nodeDefinitionToAcceptedEditorNodeDefinition),
.filter((d) => d.data && d.data.type === valueType)
.concat(
Utils.dataForTypes(defs, [ValueDefinition.InputValueDefinition]).filter(
(d) => d.data && d.data.type !== Value.ObjectValue,
),
)
.map(Utils.nodeDefinitionToAcceptedEditorNodeDefinition),
},
];
return scalarDefinitions;
};
const BooleanDefintions = generateScalarDefinitions(ScalarTypes.Boolean, Value.BooleanValue, help.Boolean);
const FloatDefintions = generateScalarDefinitions(ScalarTypes.Float, Value.FloatValue, help.Float);
const IDDefintions = generateScalarDefinitions(ScalarTypes.ID, Value.StringValue, help.ID);
const IntDefinitions = generateScalarDefinitions(ScalarTypes.Int, Value.IntValue, help.Int);
const StringDefinitions = generateScalarDefinitions(ScalarTypes.String, Value.StringValue, help.String);
return [
...BooleanDefintions,
...FloatDefintions,
...[IDDefintions[0], IDDefintions[2]],
...IntDefinitions,
...StringDefinitions,
];
}
}