Skip to content

Commit

Permalink
Merge pull request #17 from joaopaulomoraes/chore/improve-docs
Browse files Browse the repository at this point in the history
Improve docs
  • Loading branch information
joaopaulomoraes authored Apr 28, 2024
2 parents af5c227 + 51870a4 commit ff8b89b
Show file tree
Hide file tree
Showing 5 changed files with 373 additions and 326 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
}
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MIT License
# MIT License

Copyright (c) 2023 João Paulo Moraes

Expand Down
80 changes: 52 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Manage complex object keys in depth.
- [json-object-keys | ⚠️ WIP ⚠️](#json-object-keys--️-wip-️)
- [Table of contents](#table-of-contents)
- [Install](#install)
- [Bun](#bun)
- [PNPM](#pnpm)
- [NPM](#npm)
- [Yarn](#yarn)
- [Remove](#remove)
- [Remove an unique key](#remove-an-unique-key)
- [Remove multiple keys](#remove-multiple-keys)
Expand All @@ -19,10 +23,30 @@ Manage complex object keys in depth.

## Install

### Bun

```sh
bun add json-object-keys
```

### PNPM

```sh
pnpm add json-object-keys
```

### NPM

```sh
npm install json-object-keys
```

### Yarn

```sh
yarn add json-object-keys
```

## Remove

### Remove an unique key
Expand All @@ -46,13 +70,13 @@ remove(
Output

```diff
+{
+ id: 'e059d01a-7082-4b63-9c70-997491cdcf7c',
+ name: 'John Doe',
- category: '65bf5579-710d-4f56-9907-8c0bb1b2f0d2',
+ email: '[email protected]',
+ age: 29
+}
{
id: 'e059d01a-7082-4b63-9c70-997491cdcf7c',
name: 'John Doe',
- category: '65bf5579-710d-4f56-9907-8c0bb1b2f0d2',
email: '[email protected]',
age: 29
}
```

### Remove multiple keys
Expand All @@ -75,13 +99,13 @@ remove(
Output

```diff
+{
+ id: 'e059d01a-7082-4b63-9c70-997491cdcf7c',
+ name: 'John Doe',
- category: '65bf5579-710d-4f56-9907-8c0bb1b2f0d2',
- email: '[email protected]',
+ age: 29
+}
{
id: 'e059d01a-7082-4b63-9c70-997491cdcf7c',
name: 'John Doe',
- category: '65bf5579-710d-4f56-9907-8c0bb1b2f0d2',
- email: '[email protected]',
age: 29
}
```

## Replace
Expand Down Expand Up @@ -129,20 +153,20 @@ replace(
Output

```diff
{
+ id: '65bf5579-710d-4f56-9907-8c0bb1b2f0d2',
name: 'Grandchild 1',
+ node: [
{
+ id: 'e059d01a-7082-4b63-9c70-997491cdcf7c',
name: 'Great Grandchild 1'
},
{
+ id: 'c579a0b8-c2c7-44e2-a7d9-2edba8f7b472',
name: 'Great Grandchild 2'
}
]
}
{
+ id: '65bf5579-710d-4f56-9907-8c0bb1b2f0d2',
name: 'Grandchild 1',
+ node: [
{
+ id: 'e059d01a-7082-4b63-9c70-997491cdcf7c',
name: 'Great Grandchild 1'
},
{
+ id: 'c579a0b8-c2c7-44e2-a7d9-2edba8f7b472',
name: 'Great Grandchild 2'
}
]
}
```

## License
Expand Down
Loading

0 comments on commit ff8b89b

Please sign in to comment.