ts-partial-types
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

ts-partial-types

PartialOnly<T, U>

TypeScript's Partial<T> mapped type makes all of the type's properties optional. This variation makes only the specified keys optional.

PartialExcept<T, U>

TypeScript's Partial<T> mapped type makes all of the type's properties optional. This variation makes all properties optional except those specified.

Without<T, U>

TypeScript's Pick<T, K> mapped type returns a type that only includes the specified keys. This type complements it by returning a type with only those keys that are not specified.

PartialWithout<T, U>

TypeScript's Pick<T, K> mapped type returns a type that only includes the specified keys. This type complements it by returning a type with only those keys that are not specified, and makes all of the remaining properties optional as in Partial<T>.

updateObject

Update an object's properties with values from an object with a subset of the object's properties. Returns a new object.

This is essentially a typed wrapper around the merge function from Lodash.

/ts-partial-types/

    Package Sidebar

    Install

    npm i ts-partial-types

    Weekly Downloads

    4

    Version

    0.2.2

    License

    MIT

    Unpacked Size

    157 kB

    Total Files

    12

    Last publish

    Collaborators

    • chadnorvell