Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "Object/MergeUp"

Index

Type aliases

MergeUp

MergeUp<O, O1, depth>: { 'flat': MergeUpFlat<O, O1>; 'deep': { [K in keyof (O & O1)]: Kind<NonNullable<At<O, K> & At<O1, K>>> extends "object" ? { [K in keyof ((K extends NullableKeys<O> ? { 1: OptionalFlat<At<O, K> & {}>; 0: Compute<OptionalFlat<Pick<At<O, K> & {}, Keys<At<O, K> & {}>>> & Pick<At<O, K> & {}, Exclude<keyof At<O, K>, keyof Pick<At<O, K> & {}, Keys<At<O, K> & {}>>>>>; }[Implements<Keys<At<O, K> & {}>, Keys<At<O, K> & {}>>] : At<O, K> & {}) & (K extends NullableKeys<O1> ? { 1: OptionalFlat<At<O1, K> & {}>; 0: Compute<OptionalFlat<Pick<At<O1, K> & {}, Keys<At<O1, K> & {}>>> & Pick<At<O1, K> & {}, Exclude<keyof At<O1, K>, keyof Pick<At<O1, K> & {}, Keys<At<O1, K> & {}>>>>>; }[Implements<Keys<At<O1, K> & {}>, Keys<At<O1, K> & {}>>] : At<O1, K> & {}))]: Kind<NonNullable<At<K extends NullableKeys<O> ? { 1: OptionalFlat<At<O, K> & {}>; 0: Compute<OptionalFlat<Pick<At<O, K> & {}, Keys<At<O, K> & {}>>> & Pick<At<O, K> & {}, Exclude<keyof At<O, K>, keyof Pick<At<O, K> & {}, Keys<At<O, K> & {}>>>>>; }[Implements<Keys<At<O, K> & {}>, Keys<At<O, K> & {}>>] : At<O, K> & {}, K> & At<K extends NullableKeys<O1> ? { 1: OptionalFlat<At<O1, K> & {}>; 0: Compute<OptionalFlat<Pick<At<O1, K> & {}, Keys<At<O1, K> & {}>>> & Pick<At<O1, K> & {}, Exclude<keyof At<O1, K>, keyof Pick<At<O1, K> & {}, Keys<At<O1, K> & {}>>>>>; }[Implements<Keys<At<O1, K> & {}>, Keys<At<O1, K> & {}>>] : At<O1, K> & {}, K>>> extends "object" ? any : any; } | (K extends { [K in keyof any]-?: any; }[Keys<O>] ? any : any) : any; }; }[depth]

Accurately complete the fields of O with the ones of O1. This is a version of Merge that handles optional fields. It understands that merged optional fields are no longer optional (have been completed).

Type parameters

  • O: object

    to complete

  • O1: object

    to copy from

  • depth: Depth

    to do it deeply (?='flat')

returns

object

example

MergeUpDeep

MergeUpDeep<O, O1, OOK, NOK, NO1K>: object & __type

Type parameters

MergeUpFlat

MergeUpFlat<O, O1>: object

Type parameters

  • O: object
  • O1: object

MergeUpProp

MergeUpProp<O, O1, K, OOK>: MergeUpProp<O, O1, K, OOK>

Type parameters

Made with ❤️ by pirix-gh. Documentation generated by TypeDoc.