假设我有一堆添加到查询构建器中的函数: let query = User.query();query = filterLocation但是,如果我需要这些函数中的一个是异步的(例如,获取一些数据),我不能await该函数,因为它将解析整个查询。filterLocation(query, location); // `query` is now resolved to a list of users, but I wan
基本上就是读取一个文件,然后返回内容。现在,它返回promise本身。这是一种直接返回结果的方法吗?condi = this.validateFileName(fileName);
// wrap api, then wait
var promise= new Promise((res, rej) =