refactor: use built-in `isPromise` (#4272)