diegohaz / diegohaz/schm

deepmerge in defaultSchmea merge function

Open
#49 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
511
Forks
23
PR merge metrics
No merged PRs in 30d

Description

In defaultSchema merge function you have:

```js
const merged = merge({}, this, ...schemas)
```
is there a reason for using lodash' deepMerge instead of a simple reduce:

```js
const merged = schemas.reduce((merged, schema) => ({...merged, ...schema}), this)
```

Using lodash merge makes it incredibly slow with a lot of refs to other schemas and even worse if you want to use self referencing

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.