# @lindeneg/types

> Utility types.

Latest version **1.1.6** (published 2022-03-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @lindeneg/types
pnpm add @lindeneg/types
yarn add @lindeneg/types
bun add @lindeneg/types
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.6 |
| Published | 2022-03-10 |
| First published | 2022-01-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | lindeneg |
| Maintainers | christianlindeneg |
| Keywords | typescript |

## Links

- npm: https://www.npmjs.com/package/@lindeneg/types
- Repository: https://github.com/Lindeneg/lindeneg-npm-packages
- Homepage: https://github.com/lindeneg/lindeneg-npm-packages/tree/master/packages/types
- Issues: https://github.com/Lindeneg/lindeneg-npm-packages/issues
- npm.io page: https://npm.io/package/@lindeneg/types

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.1.6 (latest) — 2022-03-10
- 1.1.5 — 2022-02-19
- 1.1.4 — 2022-02-19
- 1.1.3 — 2022-02-13
- 1.1.2 — 2022-01-29
- 1.1.1 — 2022-01-23
- 1.1.0 — 2022-01-23
- 1.0.5 — 2022-01-20
- 1.0.4 — 2022-01-16
- 1.0.3 — 2022-01-16
- 1.0.2 — 2022-01-16
- 1.0.1 — 2022-01-16
- 1.0.0 — 2022-01-16

## README

### @lindeneg/types

![typescript](https://badgen.net/badge/icon/typescript?icon=typescript&label) ![license](https://badgen.net/npm/license/@lindeneg/types)

Utility types.

### Installation

`yarn add -D @lindeneg/types`

### Usage

We'll use the this `User` type in the following examples:

```ts
type User = {
  id: number;
  name: {
    first: string;
    last: string;
  };
  address: {
    street: string;
    city: string;
  };
};
```

#### RecursivePartialObj

`Partial` but recursive.

```ts
import type { RecursivePartialObj } from '@lindeneg/types';

type PartialUser = RecursivePartialObj<User>;
// becomes:
{
  id?: number;
  name?: {
    first?: string;
    last?: string;
  };
  address?: {
    street?: string;
    city?: string;
  };
};
```

#### Substitute

Substitute types in an object.

```ts
import type { Substitute } from '@lindeneg/types';

type SubstitutedUser = Substitute<User, { name: [string, string] }>;
// becomes:
{
  id: number;
  name: [string, string];
  address: {
    street: string;
    city: string;
  }
}
```

#### UniqueArray

Substitute a keys type in an object with another type.

```ts
import type { UniqueArray } from '@lindeneg/types';

type Arr = UniqueArray<[1, 1, 2, 3, 4, 4, 5, 5, 5, 6, 7]>;

// becomes:
[1, 2, 3, 4, 5, 6, 7];
```

#### SafeOmit

`Omit` but with enhanced type-safety.

```ts
import type { SafeOmit } from '@lindeneg/types';

type OmittedUser = SafeOmit<User, 'name' | 'address'>;

// becomes:
{
  id: string;
}
```

---
_Source: https://npm.io/package/@lindeneg/types · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
