Skip to content

Commit

Permalink
chore: release deep-utility-types package
Browse files Browse the repository at this point in the history
This package is forked from my `deep-omit-ts` package in order to have a more accurate name.
  • Loading branch information
tobloef committed Jan 9, 2024
1 parent dbf594f commit 13a56e1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# `DeepOmit<Type, Keys>`

Utility type for omitting nested properties from a type. Fully type-safe, has nice autocompletion, and works with arrays.
Utility types for operations on nested objects. Fully type-safe, has nice autocompletion, and works with arrays.

## 📦 Installation

#### NPM
`npm install --save-dev deep-omit-ts`
`npm install --save-dev deep-utility-types`

#### Yarn
`yarn add --dev deep-omit-ts`
`yarn add --dev deep-utility-types`

## ⏱️ Quick Start

```typescript
import { DeepOmit } from 'deep-omit-ts';
import { DeepOmit } from 'deep-utility-types';

type Example = {
a: string;
Expand All @@ -31,6 +31,15 @@ type Omitted = DeepOmit<Example, 'a' | 'b.d.e'>;

## 📖 Documentation

### Available Types

* `DeepOmit<Type, Keys>`: Remove specified properties, keeping all others.
* `DeepPick<Type, Keys>`: Keep specified properties, removing all others.
* `DeepRequire<Type, Keys>`: Make specified properties non-optional, keeping all others as is.
* `DeepOptional<Type, Keys>`: Make specified properties optional, keeping all others as is.

> ⚠️ **Note:** The examples below use the `DeepOmit` type, but the same syntax applies to all other types.
### Basic Usage

`DeepOmit<Type, Keys>` is a utility type that takes two generic parameters:
Expand Down Expand Up @@ -73,7 +82,7 @@ const todoInfo: TodoInfo = {
Unlike `Omit`, `DeepOmit` can omit nested properties:

```typescript
import { DeepOmit } from 'deep-omit-ts';
import { DeepOmit } from 'deep-utility-types';

type Example = {
foo1: string;
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "deep-omit-ts",
"name": "deep-utility-types",
"version": "1.0.1",
"description": "Utility type for omitting nested properties from an object",
"description": "Utility types for operations on nested objects",
"types": "./src/index.ts",
"scripts": {
"lint": "eslint --fix .",
Expand All @@ -14,7 +14,7 @@
],
"repository": {
"type": "git",
"url": "git+https://github.com/tobloef/deep-omit-ts.git"
"url": "git+https://github.com/tobloef/deep-utility-types.git"
},
"keywords": [
"typescript",
Expand All @@ -24,9 +24,9 @@
"author": "Tobias Løfgren <tobloef@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/tobloef/deep-omit-ts/issues"
"url": "https://github.com/tobloef/deep-utility-types/issues"
},
"homepage": "https://github.com/tobloef/deep-omit-ts#readme",
"homepage": "https://github.com/tobloef/deep-utility-types#readme",
"devDependencies": {
"@commitlint/cli": "^17.6.3",
"@commitlint/config-conventional": "^17.6.3",
Expand Down

0 comments on commit 13a56e1

Please sign in to comment.