Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 464 Bytes

merge.md

File metadata and controls

31 lines (24 loc) · 464 Bytes
category
Merge Object

Merge

Merge two types into a new type. If the keys overlap, its values should be merged into an union.

Usage

import type { Merge } from '@utype/core'

type Foo = {
  name: string;
  age: string;
}
type Bar = {
  age: number;
  sex: string;
}

// Expect: {
//   name: string;
//   age: number | string;
//   sex: string;
// }
type MergeResult = Merge<Foo, Bar>