提问人:BdPk 提问时间:11/14/2023 更新时间:11/14/2023 访问量:33
我想简明扼要地实现它 [已关闭]
I want to implement it concisely [closed]
问:
if (!req.query.filter) {
req.query['filter'] = {'kinds':ApplyKindsRole.USE};
}
else {
req.query.filter['kinds'] = ApplyKindsRole.USE;
}
我是新手(nodejs,打字稿)
是否可以用打字稿在一行中实现它?
答: 暂无答案
评论
req.query.filter = { ...req.query.filter, kinds: ApplyKindsRole.USE }
(req.query.filter ??= {}).kind = ApplyKindsRole.USE;