isPromiseLike<T>(value: T | PromiseLike<T>): value is PromiseLike<T>
Reports whether a value is thenable, by the same duck-typed test the
platform serve layers use rather than instanceof Promise.
The distinction is load-bearing on the request path (M87). instanceof
asks whether a value was built by this realm's Promise constructor, and
answers false for a promise from another realm (a vm context, a worker)
and for every userland promise library. Those values satisfy
RouteHandler's declared Promise<HandlerResult> structurally,
so TypeScript accepts them and only the runtime check can tell them apart —
and a request path that treats one as "already finished" sends the response
while the handler is still running, with no error anywhere.
Both @setu-ts/kernel and @setu-ts/runtime decide "did this need
awaiting?" on the hot path, so the rule lives here and neither can drift
from the other about what counts as asynchronous.
value is PromiseLike<T>
true when the value exposes a callable then