s*****w 发帖数: 1527 | 1 有没有这样的写法?
pseudo code这么写,请大家看看应该怎么改正。
const myRedirect = (routePath) => {
newUrl = routePath;
if (matches condition)
newUrl = do_some_modification(routePath);
return next(newUrl);
}
const myFunc = (routePath, myRedirect) => (newUrl, middleware) => {
return (ctx, newUrl, next) => {
return middleware(ctx, newUrl, next);
}
}; |
|