fastify / deepmerge

Merges the enumerable properties of two or more objects deeply. Fastest implementation of deepmerge
Other
80 stars 11 forks source link

The reason behind the `all` option #28

Open songkeys opened 1 year ago

songkeys commented 1 year ago

Prerequisites

Issue

I'm curious about the purpose of the all option. From the code, it appears that _deepmergeAll is the same as _deepmerge when two arguments are present, but can also be used for other n-argument cases. Could we use _deepmergeAll as the default option? Have I overlooked something?

Uzlopak commented 1 year ago

The typescript typings are recursively determining the final object shape and thus can slow down your typescript transpilation and your IDE, like vscode.

songkeys commented 1 year ago

Oh yes. I forgot about the typescript typing. Is ...args: T[] an option to solve this alternatively btw?

Meanwhile I think we should state clearly in the doc. The current description is too vague about this option.

Uzlopak commented 1 year ago

You can provide a PR if you like.