[Typescript] Accept Anything Except Null or Undefined
const acceptAnythingExceptNullOrUndefined = <T>(input: {}) => {};
acceptAnythingExceptNullOrUndefined('hello');
acceptAnythingExceptNullOrUndefined(42);
acceptAnythingExceptNullOrUndefined(true);
acceptAnythingExceptNullOrUndefined(Symbol('foo'));
acceptAnythingExceptNullOrUndefined({});
acceptAnythingExceptNullOrUndefined([]);
acceptAnythingExceptNullOrUndefined(() => {});
acceptAnythingExceptNullOrUndefined(/foo/);
acceptAnythingExceptNullOrUndefined(new Error('foo'));
acceptAnythingExceptNullOrUndefined(
// @ts-expect-error
null
);
acceptAnythingExceptNullOrUndefined(
// @ts-expect-error
undefined
);