chore: tidy
This commit is contained in:
parent
7df8791fab
commit
5405ed6e36
|
@ -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) => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user