Skip to content

Commit

Permalink
docs: create defuSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
ferferga committed Aug 27, 2023
1 parent f3afd39 commit 9e06ef9
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 @@ -127,6 +127,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 9e06ef9

Please sign in to comment.