找出账户名管道里的 bug

来自 柯里化与函数组合
Node 24 进阶 4分钟 找出 1处问题

找出这段生成的账户名称管道中的契约错误。

JavaScript
const pipe = (...steps) => input =>
  steps.reduce((value, step) => step(value), input);

const load = async id => ({ id, name: 'Ada' });
const getName = account => account.name;

const loadName = pipe(load, getName);
loadName(7).then(console.log);
在试验场中打开
报告错误