diff --git a/src/client/types/typing.js b/src/client/types/typing.js index a10b5e8..e1c7c76 100644 --- a/src/client/types/typing.js +++ b/src/client/types/typing.js @@ -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) => {