/** * 处理 `R | (...args) => R` 类似类型 * (ts <= 3.2 时无法依赖 typeof x === "function" 自动推导) */ export function isCallable
( target: R | ((...args: P) => R) ): target is (...args: P) => R { return typeof target === "function"; }