Bot releases are visible (Hide)
Published by unional about 2 years ago
Pick
when it is not needed.Published by unional about 2 years ago
afa4606: Improve unpartial(base, partial)
type.
The type for unpartial(parent, base, partial)
is marked as deprecated.
The type is loosened now similar to required(parent, base, partial)
to make it more flexible.
But note that it is incorrect as the values are not deeply merged.
Published by unional about 2 years ago
6070a75: Update types to fix some use cases.
It is now based on the type from required()
but make some improvements.
| undefined
propertyPublished by github-actions[bot] about 2 years ago
dabbde0: The unpartial()
is rewritten to improve its type management,
and ignore undefined
and null
properties.
While this can be considered as a fix,
it is better to release it as a breaking change this change might accidentally break consuming code.
Published by unional over 2 years ago
Add ESM support
Published by unional almost 7 years ago
In this release, unpartial()
will return a more sensible value when partial
is undefined.
e.g.:
const config = unpartial({ a: 1 }, undefined) // { a: 1 }
const config = unpartial({ a: 1 }, null, undefined) // { a: 1 }
Published by unional about 7 years ago
Support usage: unpartial(defaultConfig, configFromJson, givenConfig)
This means base
can be undefined
.
The behavior when encountering undefined
/null
is adjusted to better support this use case.
Published by unional about 7 years ago
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.