TehShrike / deepmerge

A library for deep (recursive) merging of Javascript objects
MIT License
2.75k stars 216 forks source link

Add TypeScript Types #211

Open RebeccaStevens opened 3 years ago

RebeccaStevens commented 3 years ago

This is a continuation of the work @bryan-hunter did in #198.

Fixes #147, fixes #179. Closes: #148, closes #181, closes #198.

RebeccaStevens commented 3 years ago

Getting the types right on this library is way harder than I though it would be. :tired_face:

RebeccaStevens commented 3 years ago

This has really turned into a much bigger job than I initially thought it would be (or maybe I'm just doing a bit of overkill :stuck_out_tongue:).

Anyway, @TehShrike I think I've got the types right now. (idk what Travis is doing, it hasn't successfully booted a vm all day). Would you be able to review? Or get someone else to?

I might add some more test and maybe refactor things a little more so they are easier to follow - even I am getting a little confused with all the mapped types going on.

Also, small note: Some of the parts of the typings rely on some new features in TypeScript 4.1 which isn't out yet (I'm using the RC). I believe TS 4.1 will be released sometime next week.

z0d14c commented 4 months ago

Why didn't we ever merge this?

RebeccaStevens commented 4 months ago

@z0d14c https://github.com/RebeccaStevens/deepmerge-ts