chore: tidy
This commit is contained in:
parent
7df8791fab
commit
5405ed6e36
|
@ -119,24 +119,8 @@ export function stepsOptions(context, steps, type) {
|
||||||
return optionsList;
|
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) {
|
export function typeFromSteps(context, steps) {
|
||||||
if (!steps || 0 === steps.length) {
|
return 0 === steps.length ? 'undefined' : descriptionFromSteps(context, steps).type;
|
||||||
return 'undefined';
|
|
||||||
}
|
|
||||||
const [, type] = steps.slice(1).reduce(stepTo, context.get(steps[0].key));
|
|
||||||
return type;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultInvocation = (context, steps) => {
|
const defaultInvocation = (context, steps) => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user