chore: tidy

This commit is contained in:
cha0s 2020-06-22 15:42:46 -05:00
parent 7df8791fab
commit 5405ed6e36

View File

@ -119,24 +119,8 @@ export function stepsOptions(context, steps, type) {
return optionsList;
}
const stepTo = ([variable, type], step) => {
const {key} = step;
if (key) {
const description = Context.typeDescription(type, variable);
return [
'object' === typeof variable ? variable[key] : undefined,
description[key] ? description[key].type : type,
];
}
return [variable, type];
};
export function typeFromSteps(context, steps) {
if (!steps || 0 === steps.length) {
return 'undefined';
}
const [, type] = steps.slice(1).reduce(stepTo, context.get(steps[0].key));
return type;
return 0 === steps.length ? 'undefined' : descriptionFromSteps(context, steps).type;
}
const defaultInvocation = (context, steps) => {