# NotUndefined

## `NotUndefined<Type>`

A generic type `NotUndefined` represents any type instead of [`undefined`](https://www.typescriptlang.org/docs/handbook/basic-types.html#null-and-undefined). It takes generic type variable [`Type`](#type) constrained by [`undefined`](https://www.typescriptlang.org/docs/handbook/basic-types.html#null-and-undefined) which constraint causes its change to [`never`](https://www.typescriptlang.org/docs/handbook/basic-types.html#never).

{% code title="not-undefined.type.ts" %}

```typescript
type NotUndefined<Type> = Type extends undefined ? never : Type;
```

{% endcode %}

{% embed url="<https://github.com/angular-package/type/blob/main/src/type/not-undefined.type.ts>" %}

### Generic type variables

#### `Type`

A generic type `Type` that is never [`undefined`](https://www.typescriptlang.org/docs/handbook/basic-types.html#null-and-undefined).
