<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mizugumo</author_name>
  <author_url>https://blog.hatena.ne.jp/mizugumo/</author_url>
  <blog_title>メモ帳</blog_title>
  <blog_url>https://mizmo.hateblo.jp/</blog_url>
  <categories>
    <anon>TypeScript</anon>
  </categories>
  <description>外部からデータを受け取る場合、アプリが停止することを防ぐためにデータの型をチェックする必要がある typeof演算子やin演算子の他、ユーザー定義型ガードを利用することでチェックできる 例 { &quot;setting1&quot;: 1, &quot;setting2&quot;: &quot;a&quot; } import * as data from &quot;./json/data.json&quot;; type Data = { setting1: number, setting2: string, } /** * ユーザ定義型ガード * 関数の返り値の型を 引数 X is T と書くことで、 * 条件がtrueを返す場合は X は T であり、 * f…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmizmo.hateblo.jp%2Fentry%2F2022%2F08%2F18%2F075000&quot; title=&quot;ユーザー定義型ガード - メモ帳&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>2022-08-18 07:50:00</published>
  <title>ユーザー定義型ガード</title>
  <type>rich</type>
  <url>https://mizmo.hateblo.jp/entry/2022/08/18/075000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
