unpartial

Unpartial a partial object

MIT License

Downloads
160.7K
Stars
4
Committers
6

Bot releases are hidden (Show)

unpartial - v1.0.5 Latest Release

Published by unional over 1 year ago

Patch Changes

  • cac4c5d: Improve exports/main/module fields
unpartial - v1.0.4

Published by unional about 2 years ago

Patch Changes

  • 4e3eba3: Omit Pick when it is not needed.
unpartial - v1.0.3

Published by unional about 2 years ago

Patch Changes

  • 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.

unpartial - v1.0.2

Published by unional about 2 years ago

Patch Changes

  • 6070a75: Update types to fix some use cases.
    It is now based on the type from required() but make some improvements.

    • Result now honors | undefined property
    • Type is constructed instead of intersect, making it easier to read
unpartial - v0.7.5

Published by unional over 2 years ago

0.7.5 (2022-06-11)

Bug Fixes

unpartial - v0.7.4

Published by unional over 2 years ago

0.7.4 (2022-06-04)

Bug Fixes

unpartial - v0.7.3

Published by unional over 2 years ago

0.7.3 (2022-05-31)

Bug Fixes

unpartial - v0.7.2

Published by unional over 2 years ago

0.7.2 (2022-05-31)

Bug Fixes

unpartial - v0.7.0

Published by unional over 2 years ago

Add ESM support

unpartial - v0.6.3

Published by unional over 5 years ago

0.6.3 (2019-05-13)

Bug Fixes

unpartial - v0.6.2

Published by unional over 5 years ago

0.6.2 (2019-05-13)

Bug Fixes

unpartial - v0.6.1

Published by unional over 5 years ago

0.6.1 (2019-05-13)

Bug Fixes

unpartial - v0.6.0

Published by unional over 5 years ago

0.6.0 (2019-05-12)

Features

unpartial - v0.5.1

Published by unional over 5 years ago

0.5.1 (2019-04-11)

Bug Fixes

unpartial - v0.5.0

Published by unional over 5 years ago

0.5.0 (2019-02-18)

Features

unpartial - Adjusted behavior when `partial` is undefined

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 }
unpartial - Supporting optional `base`

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.

unpartial - Swapped Argument

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.

unpartial - Initial release

Published by unional about 7 years ago