Composite

여러 오브젝트의 멤버들을 하나의 오브젝트로 만드는 것.

image.png

사용 예시

export const userInfoSchema = t.Composite([
  userSchema,
  t.Object({
    roles: t.Array(t.String()),
    perms: t.Array(t.String()),
    accessList: t.Array(t.String()),
  }),
]);

Union

여러 타입들을 or로 처리하는 것. 즉 A 타입 또는 B 타입과 같이 만듦.