Skip to content

Swapped Argument

Choose a tag to compare

@unional unional released this 10 Oct 08:11
· 261 commits to main since this release

The arguments are swapped and renamed.

// before
unpartial(obj, src1, src2)

// now
unpartial(base, partial)
unpartial(superBase, base, partial)

In the new arrangement, code completion is better supported,
and the new argument names better reflect their meaning.

const defaultConfig = { ... } as Config
unpartial(defaultConfig, { /* code completion for `Partial<Config>` */ })

Also, it now supports explicit type through generic:

unpartial<Config>(
  { /* code completion for `Config` */ },
  { /* code completion for `Partial<Config>` */ })

Enjoy.