我正在使用typescript,我有一个异步函数,当它被解析时,它将返回值string or undefined。say myFunction)中为一些不同的值调用此函数,并获得promise。我想删除那些未定义的值(这可以使用filter来完成),但我也不想更改我的myFunction.I的返回类型,我想保留它的返回类型Promise<string[]>而不是Promise<(string== undefined);}
我正在创建一个转换器,需要用代码placeholder替换每个调用表达式__REPLACED__,所以我编写了以下代码:import * as ts from "typescriptshow where the warning was created)
(node:9204) UnhandledPromiseRejectionWarning: Unhandled promiseTo terminate the node process on unhandled promise rejec