Skip to content

Commit

Permalink
docs: create defuSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
ferferga committed Oct 25, 2023
1 parent 43803c9 commit 51dd63c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,19 @@ defuArrayFn({

**Note:** the function is called only if the value defined in defaults is an aray.

## Schema object
You can use `defuSchema` if you want to remove keys that are not present in the default object.

```js
console.log(
defuSchema(
{ a: 1, b: 2, c: 3, d: 4 },
{ a: 2, c: 4, d: 6, e: 8 }
)
);
// => { a: 1, c: 3, d: 4, e: 8 }
``

### Remarks

- `object` and `defaults` are not modified
Expand Down

0 comments on commit 51dd63c

Please sign in to comment.