<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ema_hiro</author_name>
  <author_url>https://blog.hatena.ne.jp/ema_hiro/</author_url>
  <blog_title>emahiro/b.log</blog_title>
  <blog_url>https://ema-hiro.hatenablog.com/</blog_url>
  <categories>
    <anon>TypeScript</anon>
  </categories>
  <description>Overview 以下のような集合関係にある2つの型の間で値の再代入をしたいケースでハマってしまい、同僚のフロントエンドエンジニアに手伝ってもらって一定の方針で解決したのでその備忘録です。 type ObjA = { a: number; b: string; } type ObjB = { a: number; b: string; c: string; } この2つの関係はフィールドが集合関係にあり ObjB は ObjA として振る舞うこともできます。 調べたこと 存在しないフィールドに対して never 型にアサインしようとして型エラーになるケースがある 以下のような実装では値の再代入…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fema-hiro.hatenablog.com%2Fentry%2F2021%2F11%2F14%2F025259&quot; title=&quot;TypeScript で集合関係にある型の値の再代入をする - emahiro/b.log&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2021-11-14 02:52:59</published>
  <title>TypeScript で集合関係にある型の値の再代入をする</title>
  <type>rich</type>
  <url>https://ema-hiro.hatenablog.com/entry/2021/11/14/025259</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
