title: Is there a type definition for Typescript to allow anything BUT `any`?
body: <p>In our open source library <a href="https://github.com/thisisagile/easy" rel="nofollow noreferrer">@thisisagile/easy</a>. We have defined a type <code>Get&lt;T = unknown, Args = unknown&gt; = T | Func&lt;T, Args&gt;</code> (see <a href="https://github.com/thisisagile/easy/blob/main/packages/easy/src/types/Get.ts" rel="nofollow noreferrer"><code>Get</code></a>), which is either a function or an object, and a function <code>ofGet&lt;T&gt;()</code> that evaluates it.</p>
  <p>In some edge cases, however, when we define a get from a function that returns an <code>any</code>, the behavior is different than what you would expect. I imagine this has to do with that the compiler can't see the difference and chooses the evaluate the use of the type as <code>any</code> instead of <code>() =&gt; any</code>.</p>
  <p>So, I'm wondering if we could define a conditional type where we could exclude <code>any</code>, e.g. <code>Get&lt;T, Args&gt; = IsAnAny&lt;T&gt; ? Func&lt;T, Args&gt; : (Func&lt;T, Args&gt; | T)</code>. Any ideas?</p>