<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
<id>https://blog.publictheta.com/</id>
<title>Public Theta Blog</title>
<subtitle>Public Thetaの個人技術ブログです。</subtitle>
<link rel="self" type="application/atom+xml" href="https://blog.publictheta.com/atom.xml" />
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/" />
<updated>2024-10-19T06:19:35.545Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<generator>Public Theta Blog</generator>
<entry>
<id>https://blog.publictheta.com/tags/qemu</id>
<title type="text">QEMU</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/qemu" />
<published>2024-10-19T06:19:35.545Z</published>
<updated>2024-10-19T06:19:35.545Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html"></content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2024-10-19-qemu-aarch64-static</id>
<title type="text">x86_64のUbuntuでqemu-aarch64-staticする</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2024-10-19-qemu-aarch64-static" />
<published>2024-10-19T06:19:13.117Z</published>
<updated>2024-10-19T06:19:13.117Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="QEMU" />
<content type="html">&lt;p&gt;x86_64のUbuntu（環境はGitHub Actionsの&lt;a href=&quot;https://github.com/actions/runner-images/blob/3fbcce7888450069b9843941654e55ab7b691eb6/images/ubuntu/Ubuntu2204-Readme.md&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Ubuntu 22.04&lt;/a&gt;のランナー）で、&lt;code&gt;qemu-aarch64-static&lt;/code&gt;を使って&lt;code&gt;aarch64&lt;/code&gt;のバイナリを実行する際に、少しハマったのでメモ。&lt;/p&gt;
&lt;p&gt;単純に、&lt;code&gt;qemu-user-static&lt;/code&gt;をインストールして実行しようとすると、次のようなエラーが出る。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;sh&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;sh&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,c3VkbyBhcHQtZ2V0IHVwZGF0ZQpzdWRvIGFwdC1nZXQgaW5zdGFsbCBxZW11LXVzZXItc3RhdGlj&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-sh&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;sudo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; apt-get&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; update&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;sudo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; apt-get&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; qemu-user-static&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;sh&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;sh&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,cWVtdS1hYXJjaDY0LXN0YXRpYyBiaW4=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-sh&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;qemu-aarch64-static&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; bin&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;&quot;&gt;&lt;figcaption&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.txt&quot; href=&quot;data:text/plain;charset=utf-8;base64,L2xpYi9sZC1saW51eC1hYXJjaDY0LnNvLjE6IE5vIHN1Y2ggZmlsZSBvciBkaXJlY3RvcnkK&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre&gt;&lt;code&gt;/lib/ld-linux-aarch64.so.1: No such file or directory
&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;これはaarch64向けの&lt;code&gt;libc&lt;/code&gt;ないために起こるためで、&lt;a href=&quot;https://unix.stackexchange.com/questions/751329/qemu-aarch64-could-not-open-lib-ld-linux-aarch64-so-1-no-such-file-or-direc&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;このunix.stackexchange.com&lt;/a&gt;にある通り&lt;code&gt;arm64&lt;/code&gt;のアークテクチャを追加して、&lt;code&gt;libc6:arm6&lt;/code&gt;をインストールすればよい。&lt;/p&gt;
&lt;p&gt;ただし、ただ追加して&lt;code&gt;apt-get update&lt;/code&gt;しても404エラーが出る。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;sh&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;sh&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,c3VkbyBkcGtnIC0tYWRkLWFyY2hpdGVjdHVyZSBhcm02NA==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-sh&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;sudo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; dpkg&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --add-architecture&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; arm64&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;sh&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;sh&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,c3VkbyBhcHQtZ2V0IHVwZGF0ZQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-sh&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;sudo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; apt-get&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; update&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;&quot;&gt;&lt;figcaption&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.txt&quot; href=&quot;data:text/plain;charset=utf-8;base64,RTogRmFpbGVkIHRvIGZldGNoIGh0dHA6Ly9hcmNoaXZlLnVidW50dS5jb20vdWJ1bnR1L2Rpc3RzL2ZvY2FsL211bHRpdmVyc2UvYmluYXJ5LWFybTY0L1BhY2thZ2VzICA0MDQgIE5vdCBGb3VuZCBbSVA6IDkxLjE4OS45MS44MSA4MF0KRTogRmFpbGVkIHRvIGZldGNoIGh0dHA6Ly9hcmNoaXZlLnVidW50dS5jb20vdWJ1bnR1L2Rpc3RzL2ZvY2FsLXVwZGF0ZXMvbXVsdGl2ZXJzZS9iaW5hcnktYXJtNjQvUGFja2FnZXMgIDQwNCAgTm90IEZvdW5kIFtJUDogOTEuMTg5LjkxLjgxIDgwXQpFOiBGYWlsZWQgdG8gZmV0Y2ggaHR0cDovL3NlY3VyaXR5LnVidW50dS5jb20vdWJ1bnR1L2Rpc3RzL2ZvY2FsLXNlY3VyaXR5L21haW4vYmluYXJ5LWFybTY0L1BhY2thZ2VzICA0MDQgIE5vdCBGb3VuZCBbSVA6IDkxLjE4OS45MS44MyA4MF0KRTogRmFpbGVkIHRvIGZldGNoIGh0dHA6Ly9hcmNoaXZlLnVidW50dS5jb20vdWJ1bnR1L2Rpc3RzL2ZvY2FsLWJhY2twb3J0cy9tYWluL2JpbmFyeS1hcm02NC9QYWNrYWdlcyAgNDA0ICBOb3QgRm91bmQgW0lQOiA5MS4xODkuOTEuODEgODBdCkU6IFNvbWUgaW5kZXggZmlsZXMgZmFpbGVkIHRvIGRvd25sb2FkLiBUaGV5IGhhdmUgYmVlbiBpZ25vcmVkLCBvciBvbGQgb25lcyB1c2VkIGluc3RlYWQuCg==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre&gt;&lt;code&gt;E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/multiverse/binary-arm64/Packages  404  Not Found [IP: 91.189.91.81 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-updates/multiverse/binary-arm64/Packages  404  Not Found [IP: 91.189.91.81 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/focal-security/main/binary-arm64/Packages  404  Not Found [IP: 91.189.91.83 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal-backports/main/binary-arm64/Packages  404  Not Found [IP: 91.189.91.81 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;これはそのまま&lt;code&gt;libc6:arm6&lt;/code&gt;がリポジトリに見つからないことを指すエラーなので、&lt;a href=&quot;https://askubuntu.com/questions/430705/how-to-use-apt-get-to-download-multi-arch-library&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;このaskubuntu.com&lt;/a&gt;にある通り、ソースを追加すると解決できる。&lt;/p&gt;
&lt;p&gt;つまり例えば、&lt;code&gt;/etc/apt/sources.list.d/arm64.list&lt;/code&gt;を作成して、次のように記述する。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;sh&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;sh&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZGViIFthcmNoPWFybTY0XSBodHRwOi8vcG9ydHMudWJ1bnR1LmNvbS8gZm9jYWwgbWFpbiByZXN0cmljdGVkCmRlYiBbYXJjaD1hcm02NF0gaHR0cDovL3BvcnRzLnVidW50dS5jb20vIGZvY2FsLXVwZGF0ZXMgbWFpbiByZXN0cmljdGVkCmRlYiBbYXJjaD1hcm02NF0gaHR0cDovL3BvcnRzLnVidW50dS5jb20vIGZvY2FsIHVuaXZlcnNlCmRlYiBbYXJjaD1hcm02NF0gaHR0cDovL3BvcnRzLnVidW50dS5jb20vIGZvY2FsLXVwZGF0ZXMgdW5pdmVyc2UKZGViIFthcmNoPWFybTY0XSBodHRwOi8vcG9ydHMudWJ1bnR1LmNvbS8gZm9jYWwgbXVsdGl2ZXJzZQpkZWIgW2FyY2g9YXJtNjRdIGh0dHA6Ly9wb3J0cy51YnVudHUuY29tLyBmb2NhbC11cGRhdGVzIG11bHRpdmVyc2UKZGViIFthcmNoPWFybTY0XSBodHRwOi8vcG9ydHMudWJ1bnR1LmNvbS8gZm9jYWwtYmFja3BvcnRzIG1haW4gcmVzdHJpY3RlZCB1bml2ZXJzZSBtdWx0aXZlcnNl&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-sh&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deb&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [arch=arm64] http://ports.ubuntu.com/ focal main restricted&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deb&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [arch=arm64] http://ports.ubuntu.com/ focal-updates main restricted&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deb&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [arch=arm64] http://ports.ubuntu.com/ focal universe&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deb&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [arch=arm64] http://ports.ubuntu.com/ focal-updates universe&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deb&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [arch=arm64] http://ports.ubuntu.com/ focal multiverse&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deb&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [arch=arm64] http://ports.ubuntu.com/ focal-updates multiverse&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deb&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [arch=arm64] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;これをコマンドで行う場合は例えばこう。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;sh&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;sh&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,VUJVTlRVPSQobHNiX3JlbGVhc2UgLWNzKQoKc3VkbyB0ZWUgL2V0Yy9hcHQvc291cmNlcy5saXN0LmQvYXJtNjQubGlzdCA8PEVPRgpkZWIgW2FyY2g9YXJtNjRdIGh0dHA6Ly9wb3J0cy51YnVudHUuY29tLyAkVUJVTlRVIG1haW4gcmVzdHJpY3RlZApkZWIgW2FyY2g9YXJtNjRdIGh0dHA6Ly9wb3J0cy51YnVudHUuY29tLyAkVUJVTlRVLXVwZGF0ZXMgbWFpbiByZXN0cmljdGVkCmRlYiBbYXJjaD1hcm02NF0gaHR0cDovL3BvcnRzLnVidW50dS5jb20vICRVQlVOVFUgdW5pdmVyc2UKZGViIFthcmNoPWFybTY0XSBodHRwOi8vcG9ydHMudWJ1bnR1LmNvbS8gJFVCVU5UVS11cGRhdGVzIHVuaXZlcnNlCmRlYiBbYXJjaD1hcm02NF0gaHR0cDovL3BvcnRzLnVidW50dS5jb20vICRVQlVOVFUgbXVsdGl2ZXJzZQpkZWIgW2FyY2g9YXJtNjRdIGh0dHA6Ly9wb3J0cy51YnVudHUuY29tLyAkVUJVTlRVLXVwZGF0ZXMgbXVsdGl2ZXJzZQpkZWIgW2FyY2g9YXJtNjRdIGh0dHA6Ly9wb3J0cy51YnVudHUuY29tLyAkVUJVTlRVLWJhY2twb3J0cyBtYWluIHJlc3RyaWN0ZWQgdW5pdmVyc2UgbXVsdGl2ZXJzZQpFT0Y=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-sh&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;UBUNTU&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;lsb_release&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -cs&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;sudo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; tee&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; /etc/apt/sources.list.d/arm64.list&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &amp;#x3C;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;EOF&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;deb [arch=arm64] http://ports.ubuntu.com/ &lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$UBUNTU&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; main restricted&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;deb [arch=arm64] http://ports.ubuntu.com/ &lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$UBUNTU&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;-updates main restricted&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;deb [arch=arm64] http://ports.ubuntu.com/ &lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$UBUNTU&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; universe&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;deb [arch=arm64] http://ports.ubuntu.com/ &lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$UBUNTU&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;-updates universe&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;deb [arch=arm64] http://ports.ubuntu.com/ &lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$UBUNTU&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; multiverse&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;deb [arch=arm64] http://ports.ubuntu.com/ &lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$UBUNTU&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;-updates multiverse&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;deb [arch=arm64] http://ports.ubuntu.com/ &lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$UBUNTU&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;-backports main restricted universe multiverse&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;EOF&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;加えて、デフォルトの&lt;code&gt;/etc/apt/sources.list&lt;/code&gt;を現在のアーキテクチャ専用に書き換えておく必要がある。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;sh&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;sh&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,IyDlv7Xjga7ngrrjg5Djg4Pjgq/jgqLjg4Pjg5cKc3VkbyBjcCAvZXRjL2FwdC9zb3VyY2VzLmxpc3QgL2V0Yy9hcHQvc291cmNlcy5saXN0LmJhawoKIyDkvovjgYjjgbBhbWQ2NApBUkNIPSQoZHBrZyAtLXByaW50LWFyY2hpdGVjdHVyZSkKCiMg572u5o+bCnN1ZG8gc2VkIC1pICJzL2RlYiAvZGViIFthcmNoPSRBUkNIXSAvZyIgL2V0Yy9hcHQvc291cmNlcy5saXN0&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-sh&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 念の為バックアップ&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;sudo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; cp&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; /etc/apt/sources.list&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; /etc/apt/sources.list.bak&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 例えばamd64&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ARCH&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;dpkg&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --print-architecture&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 置換&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;sudo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; sed&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -i&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;s/deb /deb [arch=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$ARCH&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;] /g&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; /etc/apt/sources.list&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;これで、&lt;code&gt;libc6:arm6&lt;/code&gt;をインストールでき、&lt;code&gt;qemu-aarch64-static&lt;/code&gt;による&lt;code&gt;aarch64&lt;/code&gt;バイナリの実行が可能になるはず。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;sh&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;sh&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,c3VkbyBhcHQtZ2V0IGluc3RhbGwgbGliYzY6YXJtNg==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-sh&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;sudo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; apt-get&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; libc6:arm6&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;sh&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;sh&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,cWVtdS1hYXJjaDY0LXN0YXRpYyBiaW4=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-sh&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;qemu-aarch64-static&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; bin&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/windows</id>
<title type="text">Windows</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/windows" />
<published>2024-10-19T05:44:07.333Z</published>
<updated>2024-10-19T05:44:07.333Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html"></content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2024-10-19-rust-i686-w64-mingw32-gcc</id>
<title type="text">Windows上でのi686-pc-windows-gnu向けRustビルドで&quot;linker `i686-w64-mingw32-gcc` not found&quot;が出る</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2024-10-19-rust-i686-w64-mingw32-gcc" />
<published>2024-10-19T05:38:40.472Z</published>
<updated>2024-10-19T05:38:40.472Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Rust" /><category term="Windows" />
<content type="html">&lt;p&gt;GitHub ActionsのWindowsのランナーでターゲットを&lt;code&gt;i686-pc-windows-gnu&lt;/code&gt;にしてRustのバイナリーをビルドしようとしたら、以下のエラーが出た。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;text&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;text&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.text&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZXJyb3I6IGxpbmtlciBgaTY4Ni13NjQtbWluZ3czMi1nY2NgIG5vdCBmb3VuZAogIHwKICA9IG5vdGU6IHByb2dyYW0gbm90IGZvdW5k&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;error: linker `i686-w64-mingw32-gcc` not found&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  = note: program not found&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;原因は、ターゲットを追加してもコンパイルに必要な&lt;code&gt;rust-mingw&lt;/code&gt;というコンポーネントがインストールされないこと（&lt;a href=&quot;https://github.com/rust-lang/rustup/issues/607&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;rust-lang/rustup#607&lt;/a&gt;）だったので、インストールのコマンドを次のようにすることで解決した。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,cnVzdHVwIHRvb2xjaGFpbiBpbnN0YWxsIHN0YWJsZS1pNjg2LXBjLXdpbmRvd3MtZ251CnJ1c3R1cCBkZWZhdWx0IHN0YWJsZS1pNjg2LXBjLXdpbmRvd3MtZ251&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;rustup&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; toolchain&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; stable-i686-pc-windows-gnu&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;rustup&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; default&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; stable-i686-pc-windows-gnu&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2024-06-14-cargo-target</id>
<title type="text">Rustのtargetディレクトリをあるディレクトリ以下で共有する</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2024-06-14-cargo-target" />
<published>2024-06-14T04:08:21.822Z</published>
<updated>2024-06-14T04:08:21.822Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Rust" /><category term="Cargo" />
<content type="html">&lt;p&gt;Rustのビルドによるアーティファクトはビルドのキャッシュを含め、すべて&lt;code&gt;target&lt;/code&gt;ディレクトリに出力される。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://doc.rust-lang.org/cargo/guide/build-cache.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://doc.rust-lang.org/cargo/guide/build-cache.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;デフォルトでは、&lt;code&gt;target&lt;/code&gt;ディレクトリはプロジェクトのルートディレクトリ、すなわち（ワークスペースであればワークスペースの）&lt;code&gt;Cargo.toml&lt;/code&gt;があるディレクトリに作成されるが、複数のプロジェクトで多くの同じパッケージを依存関係として持つ場合、同じものをプロジェクトごとにビルドすることになるため、ビルド時間的にもディスク容量的にもかなりの重複が生じることになる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;plaintext&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;plaintext&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.plaintext&quot; href=&quot;data:text/plain;charset=utf-8;base64,cHJvamVjdC1hL3RhcmdldC8uLi4KcHJvamVjdC1iL3RhcmdldC8uLi4KcHJvamVjdC1jL3RhcmdldC8uLi4=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-plaintext&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;project-a/target/...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;project-b/target/...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;project-c/target/...&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;より高度な方法として、&lt;a href=&quot;https://github.com/mozilla/sccache&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;sccache&lt;/a&gt;のようなツールを使うこともできるが、単純な方法として、Cargoの設定で&lt;code&gt;target&lt;/code&gt;ディレクトリに同じディレクトリを使うように指定することができる。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://doc.rust-lang.org/cargo/reference/config.html#buildtarget-dir&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://doc.rust-lang.org/cargo/reference/config.html#buildtarget-dir&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;環境変数&lt;code&gt;CARGO_TARGET_DIR&lt;/code&gt;を設定したり、&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZXhwb3J0IENBUkdPX1RBUkdFVF9ESVI9Ii9wYXRoL3RvL3NoYXJlZC90YXJnZXQi&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; CARGO_TARGET_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;/path/to/shared/target&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;$CARGO_HOME/config.toml&lt;/code&gt;に&lt;code&gt;build.target-dir&lt;/code&gt;を設定したり、&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;toml&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;toml&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.toml&quot; href=&quot;data:text/plain;charset=utf-8;base64,W2J1aWxkXQp0YXJnZXQtZGlyID0gIi9wYXRoL3RvL3NoYXJlZC90YXJnZXQi&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-toml&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;build&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;target-dir = &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;/path/to/shared/target&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;といった方法があるが、実はこれらより先に、現在のディレクトリ以上にある&lt;code&gt;.cargo/config.toml&lt;/code&gt;を下から上へと再帰的に読んでくれるという仕組みがあるので、これを使うと、プロジェクトごとだったり、親ディレクトリごとだったりに、&lt;code&gt;target&lt;/code&gt;ディレクトリを指定することもできる。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://doc.rust-lang.org/cargo/reference/config.html#hierarchical-structure&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;.cargo/config.toml&lt;/code&gt;の相対パスは、&lt;code&gt;.cargo&lt;/code&gt;のあるディレクトリを基準として解釈される。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://doc.rust-lang.org/cargo/reference/config.html#config-relative-paths&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://doc.rust-lang.org/cargo/reference/config.html#config-relative-paths&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;なので、例えば次のような&lt;code&gt;.cargo/config.toml&lt;/code&gt;を作成することで、そのディレクトリ以下のすべてのプロジェクトで同じ&lt;code&gt;target&lt;/code&gt;ディレクトリ（&lt;code&gt;.cargo/target&lt;/code&gt;）を使うようにできる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;toml&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;toml&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.toml&quot; href=&quot;data:text/plain;charset=utf-8;base64,W2J1aWxkXQp0YXJnZXQtZGlyID0gIi5jYXJnby90YXJnZXQi&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-toml&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;build&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;target-dir = &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;.cargo/target&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;plaintext&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;plaintext&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.plaintext&quot; href=&quot;data:text/plain;charset=utf-8;base64,LmNhcmdvL2NvbmZpZy50b21sCi5jYXJnby90YXJnZXQvLi4uCnByb2plY3QtYS8KcHJvamVjdC1iLwpwcm9qZWN0LWMv&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-plaintext&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;.cargo/config.toml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;.cargo/target/...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;project-a/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;project-b/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;project-c/&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;その際、あるプロジェクトだけ例外として扱いたい場合は、現在のディレクトリを含めてより近いディレクトリにある&lt;code&gt;.cargo/config.toml&lt;/code&gt;が優先されるので、そのプロジェクトのディレクトリに次のような&lt;code&gt;.cargo/config.toml&lt;/code&gt;を作成して、&lt;code&gt;target&lt;/code&gt;ディレクトリを指定すれば良い。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;toml&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;toml&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.toml&quot; href=&quot;data:text/plain;charset=utf-8;base64,W2J1aWxkXQp0YXJnZXQtZGlyID0gInRhcmdldCI=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-toml&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;build&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;target-dir = &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;target&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;例えば、&lt;code&gt;project-c&lt;/code&gt;にこのファイルを追加した場合、&lt;code&gt;project-c&lt;/code&gt;のビルド結果は&lt;code&gt;project-c/target&lt;/code&gt;に出力されるようになる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;plaintext&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;plaintext&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.plaintext&quot; href=&quot;data:text/plain;charset=utf-8;base64,LmNhcmdvL2NvbmZpZy50b21sCi5jYXJnby90YXJnZXQvLi4uCnByb2plY3QtYS8KcHJvamVjdC1iLwpwcm9qZWN0LWMvLmNhcmdvL2NvbmZpZy50b21sCnByb2plY3QtYy90YXJnZXQvLi4u&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-plaintext&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;.cargo/config.toml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;.cargo/target/...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;project-a/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;project-b/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;project-c/.cargo/config.toml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;project-c/target/...&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;このような使い方をする場合、&lt;code&gt;.gitignore_global&lt;/code&gt;などに&lt;code&gt;.cargo/config.toml&lt;/code&gt;を追加しておくと良いかもしれない。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;gitignore&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;gitignore&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.gitignore&quot; href=&quot;data:text/plain;charset=utf-8;base64,LmNhcmdvL2NvbmZpZy50b21sCg==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre&gt;&lt;code class=&quot;language-gitignore&quot;&gt;.cargo/config.toml
&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;ただし、その場合は逆に&lt;code&gt;target&lt;/code&gt;ディレクトリを&lt;code&gt;.gitignore&lt;/code&gt;に追加することを忘れないようにしなければならないだろう。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;gitignore&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;gitignore&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.gitignore&quot; href=&quot;data:text/plain;charset=utf-8;base64,L3RhcmdldAo=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre&gt;&lt;code class=&quot;language-gitignore&quot;&gt;/target
&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2024-05-20-webpack-swc</id>
<title type="text">webpackでswcを使う</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2024-05-20-webpack-swc" />
<published>2024-05-20T11:19:20.373Z</published>
<updated>2024-05-20T11:19:20.373Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="webpack" />
<content type="html">&lt;p&gt;&lt;code&gt;webpack&lt;/code&gt;でTypeScriptをトランスパイルする際に、&lt;code&gt;ts-loader&lt;/code&gt;の代わりに&lt;code&gt;esbuild&lt;/code&gt;（&lt;code&gt;esbuild-loader&lt;/code&gt;）を使うこともできるが、&lt;a href=&quot;https://swc.rs/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;swc&lt;/code&gt;&lt;/a&gt;（&lt;a href=&quot;https://swc.rs/docs/usage/swc-loader&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;swc-loader&lt;/code&gt;&lt;/a&gt;）を使うこともできる。&lt;/p&gt;
&lt;p&gt;依存関係には、&lt;code&gt;@swc/core&lt;/code&gt;と&lt;code&gt;swc-loader&lt;/code&gt;を追加する。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,IyBucG0KbnBtIGluc3RhbGwgLUQgQHN3Yy9jb3JlIHN3Yy1sb2FkZXIKIyB5YXJuCnlhcm4gYWRkIC1EIEBzd2MvY29yZSBzd2MtbG9hZGVyCiMgcG5wbQpwbnBtIGFkZCAtRCBAc3djL2NvcmUgc3djLWxvYWRlcg==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# npm&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -D&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; @swc/core&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; swc-loader&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# yarn&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;yarn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; add&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -D&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; @swc/core&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; swc-loader&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# pnpm&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;pnpm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; add&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -D&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; @swc/core&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; swc-loader&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;あとは、&lt;code&gt;ts-loader&lt;/code&gt;の代わりに&lt;code&gt;swc-loader&lt;/code&gt;を使うように設定する。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;webpack.config.js&lt;/code&gt;:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;js&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;js&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.js&quot; href=&quot;data:text/plain;charset=utf-8;base64,bW9kdWxlLmV4cG9ydHMgPSB7CiAgICBtb2R1bGU6IHsKICAgICAgICBydWxlczogWwogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICB0ZXN0OiAvXC4oW2p0XXN4Pyk/JC8sCiAgICAgICAgICAgICAgICBleGNsdWRlOiAvbm9kZV9tb2R1bGVzLywKICAgICAgICAgICAgICAgIHVzZTogewogICAgICAgICAgICAgICAgICAgIGxvYWRlcjogInN3Yy1sb2FkZXIiLAogICAgICAgICAgICAgICAgICAgIC8vIGh0dHBzOi8vc3djLnJzL2RvY3MvY29uZmlndXJhdGlvbi9jb21waWxhdGlvbgogICAgICAgICAgICAgICAgICAgIG9wdGlvbnM6IHsKICAgICAgICAgICAgICAgICAgICAgICAganNjOiB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJzZXI6IHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzeW50YXg6ICJ0eXBlc2NyaXB0IiwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0c3g6IHRydWUsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICAgICAgICAgIH0sCiAgICAgICAgICAgICAgICB9LAogICAgICAgICAgICB9LAogICAgICAgIF0sCiAgICB9LAp9Ow==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;module&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;exports&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    module: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        rules: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;            {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                test:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; /&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-light-font-weight:bold;--shiki-dark:#85E89D;--shiki-dark-font-weight:bold&quot;&gt;\.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#DBEDFF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;[jt]&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#DBEDFF&quot;&gt;sx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#DBEDFF&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;?$&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                exclude:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; /&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#DBEDFF&quot;&gt;node_modules&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                use: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                    loader: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;swc-loader&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;                    // https://swc.rs/docs/configuration/compilation&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                    options: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                        jsc: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                            parser: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                                syntax: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;typescript&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                                tsx: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                            },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                        },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;            },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        ],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;設定には&lt;code&gt;options&lt;/code&gt;を使ってもいいが、&lt;a href=&quot;https://swc.rs/docs/configuration/swcrc&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;.swcrc&lt;/code&gt;&lt;/a&gt;を使っても良い。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;webpack.config.js&lt;/code&gt;:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;js&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;js&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.js&quot; href=&quot;data:text/plain;charset=utf-8;base64,bW9kdWxlLmV4cG9ydHMgPSB7CiAgICBtb2R1bGU6IHsKICAgICAgICBydWxlczogWwogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICB0ZXN0OiAvXC4oW2p0XXN4Pyk/JC8sCiAgICAgICAgICAgICAgICBleGNsdWRlOiAvbm9kZV9tb2R1bGVzLywKICAgICAgICAgICAgICAgIHVzZTogInN3Yy1sb2FkZXIiLAogICAgICAgICAgICB9LAogICAgICAgIF0sCiAgICB9LAp9Ow==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;module&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;exports&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    module: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        rules: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;            {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                test:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; /&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-light-font-weight:bold;--shiki-dark:#85E89D;--shiki-dark-font-weight:bold&quot;&gt;\.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#DBEDFF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;[jt]&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#DBEDFF&quot;&gt;sx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#DBEDFF&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;?$&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                exclude:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; /&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#DBEDFF&quot;&gt;node_modules&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                use: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;swc-loader&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;            },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        ],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;.swcrc&lt;/code&gt;:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;json&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;json&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.json&quot; href=&quot;data:text/plain;charset=utf-8;base64,ewogICAgImpzYyI6IHsKICAgICAgICAicGFyc2VyIjogewogICAgICAgICAgICAic3ludGF4IjogInR5cGVzY3JpcHQiLAogICAgICAgICAgICAidHN4IjogdHJ1ZQogICAgICAgIH0KICAgIH0KfQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;jsc&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;parser&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;syntax&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;typescript&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;tsx&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;true&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2024-05-20-npm-serve</id>
<title type="text">npmのserveパッケージを使ってローカルサーバーを立てる</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2024-05-20-npm-serve" />
<published>2024-05-20T10:35:31.892Z</published>
<updated>2024-05-20T10:35:31.892Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="JavaScript" />
<content type="html">&lt;p&gt;&lt;a href=&quot;https://www.npmjs.com/package/serve&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;serve&lt;/code&gt;&lt;/a&gt;（&lt;a href=&quot;https://github.com/vercel/serve&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;vercel/serve&lt;/code&gt;&lt;/a&gt;）を使うと、ローカルサーバーを簡単に立てることができる。&lt;/p&gt;
&lt;p&gt;特に、Node.jsが既にインストールされている環境であれば、&lt;code&gt;npx&lt;/code&gt;や&lt;code&gt;dlx&lt;/code&gt;を使って環境を汚さずその場でサーバーを立てることができる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,IyBucG0KbnB4IHNlcnZlCiMgeWFybgp5YXJuIGRseCBzZXJ2ZQojIHBucG0KcG5wbSBkbHggc2VydmU=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# npm&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; serve&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# yarn&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;yarn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; dlx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; serve&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# pnpm&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;pnpm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; dlx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; serve&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;もちろん依存関係に追加して、&lt;code&gt;package.json&lt;/code&gt;の&lt;code&gt;scripts&lt;/code&gt;に追加するなどしても良い。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,IyBucG0KbnBtIGluc3RhbGwgLUQgc2VydmUKIyB5YXJuCnlhcm4gYWRkIC1EIHNlcnZlCiMgcG5wbQpwbnBtIGFkZCAtRCBzZXJ2ZQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# npm&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -D&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; serve&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# yarn&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;yarn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; add&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -D&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; serve&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# pnpm&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;pnpm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; add&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -D&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; serve&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;json&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;json&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.json&quot; href=&quot;data:text/plain;charset=utf-8;base64,ewogICAgInNjcmlwdHMiOiB7CiAgICAgICAgInNlcnZlIjogInNlcnZlIgogICAgfQp9&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;scripts&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;serve&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;serve&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;グローバルインストールするならこう。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,IyBucG0KbnBtIGluc3RhbGwgLWcgc2VydmUKIyB5YXJuCnlhcm4gZ2xvYmFsIGFkZCBzZXJ2ZQojIHBucG0KcG5wbSBhZGQgLWcgc2VydmU=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# npm&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -g&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; serve&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# yarn&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;yarn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; global&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; add&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; serve&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# pnpm&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;pnpm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; add&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -g&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; serve&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;コマンドラインオプションは、&lt;code&gt;-h&lt;/code&gt;（&lt;code&gt;--help&lt;/code&gt;）で確認できる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,c2VydmUgLWgKc2VydmUgLS1oZWxw&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;serve&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -h&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;serve&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --help&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;ディレクトリを指定する場合は、引数に指定する。デフォルトはカレントディレクトリ。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,c2VydmUgcHVibGlj&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;serve&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; public&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;ポートを指定する場合は、&lt;code&gt;-p&lt;/code&gt;または&lt;code&gt;-l&lt;/code&gt;（&lt;code&gt;--listen&lt;/code&gt;、より複雑な指定が可能）を使う。デフォルトは&lt;code&gt;3000&lt;/code&gt;。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,c2VydmUgLXAgODA4MApzZXJ2ZSAtbCA4MDgw&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;serve&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -p&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 8080&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;serve&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -l&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 8080&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;serve.json&lt;/code&gt;を使って設定を行うこともできる。プロパティの詳細は、&lt;a href=&quot;https://github.com/vercel/serve-handler#options&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/vercel/serve-handler#options&lt;/a&gt; を参照。&lt;/p&gt;
&lt;p&gt;公開ディレクトリを指定する場合は、&lt;code&gt;public&lt;/code&gt;プロパティを使う。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;json&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;json&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.json&quot; href=&quot;data:text/plain;charset=utf-8;base64,ewogICAgInB1YmxpYyI6ICJwdWJsaWMiCn0=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;public&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;public&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-06-24-jest-typescript-unexpected-token</id>
<title type="text">Jest + TypeScriptで`SyntaxError: Unexpected token &#39;export&#39;`が出る</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-06-24-jest-typescript-unexpected-token" />
<published>2022-06-24T13:14:13.064Z</published>
<updated>2022-06-24T13:14:13.064Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Jest" /><category term="TypeScript" />
<content type="html">&lt;p&gt;TypeScriptのプロジェクトに&lt;a href=&quot;https://github.com/kulshekhar/ts-jest&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;ts-jest&lt;/code&gt;&lt;/a&gt;を使って&lt;a href=&quot;https://jestjs.io&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Jest&lt;/a&gt;を導入しようとしたところ、次のようなエラーが出た。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;text&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;text&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.text&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZXhwb3J0IHt9OwogICAgXl5eXl5eCgogICAgU3ludGF4RXJyb3I6IFVuZXhwZWN0ZWQgdG9rZW4gJ2V4cG9ydCc=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;export {};&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    ^^^^^^&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    SyntaxError: Unexpected token &#39;export&#39;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;よく見ると、ビルド後のJavaScriptファイル（ここでは&lt;code&gt;dist&lt;/code&gt;内にあるとする）がテストファイルとして認識されていたことが原因だったので、&lt;a href=&quot;https://jestjs.io/docs/configuration&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;jest.config.js&lt;/code&gt;&lt;/a&gt;に次のような設定を追加した。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;js&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;js&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.js&quot; href=&quot;data:text/plain;charset=utf-8;base64,bW9kdWxlLmV4cG9ydHMgPSB7CiAgICAvLyDov73liqA6CiAgICB0ZXN0UGF0aElnbm9yZVBhdHRlcm5zOiBbIjxyb290RGlyPi9ub2RlX21vZHVsZXMvIiwgIjxyb290RGlyPi9kaXN0LyJdLAogICAgLy8g44OH44OV44Kp44Or44OIOgogICAgLy8gdGVzdFBhdGhJZ25vcmVQYXR0ZXJuczogWyIvbm9kZV9tb2R1bGVzLyJdLAp9&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;module&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;exports&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;    // 追加:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    testPathIgnorePatterns: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&amp;#x3C;rootDir&gt;/node_modules/&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&amp;#x3C;rootDir&gt;/dist/&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;    // デフォルト:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;    // testPathIgnorePatterns: [&quot;/node_modules/&quot;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;a href=&quot;https://jestjs.io/docs/configuration#testpathignorepatterns-arraystring&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;testPathIgnorePatterns&lt;/code&gt;&lt;/a&gt;には、ファイルのフルパスに対してマッチされる正規表現を文字列で指定するようになっている。&lt;code&gt;&amp;#x3C;rootDir&gt;&lt;/code&gt;はプロジェクトのルートディレクトリに置き換えられる。&lt;/p&gt;
&lt;p&gt;特定のディレクトリのみからテストファイルを探させたい場合は&lt;a href=&quot;https://jestjs.io/docs/configuration#roots-arraystring&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;roots&lt;/code&gt;&lt;/a&gt;を使うこともできる。ただし、そのディレクトリが存在しない場合はエラーが出るようなので注意が必要。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;js&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;js&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.js&quot; href=&quot;data:text/plain;charset=utf-8;base64,bW9kdWxlLmV4cG9ydHMgPSB7CiAgICAvLyDov73liqA6CiAgICByb290czogWyI8cm9vdERpcj4vc3JjLyIsICI8cm9vdERpcj4vdGVzdHMvIl0sCiAgICAvLyDjg4fjg5Xjgqnjg6vjg4g6CiAgICAvLyByb290czogWyI8cm9vdERpcj4iXSwKfQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;module&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;exports&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;    // 追加:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    roots: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&amp;#x3C;rootDir&gt;/src/&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&amp;#x3C;rootDir&gt;/tests/&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;    // デフォルト:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;    // roots: [&quot;&amp;#x3C;rootDir&gt;&quot;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/jest</id>
<title type="text">Jest</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/jest" />
<published>2022-06-24T13:14:13.064Z</published>
<updated>2022-06-24T13:14:13.064Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式サイト: &lt;a href=&quot;https://jestjs.io&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://jestjs.io&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;リポジトリ: &lt;a href=&quot;https://github.com/facebook/jest&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/facebook/jest&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;ドキュメンテーション: &lt;a href=&quot;https://jestjs.io/docs/getting-started&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://jestjs.io/docs/getting-started&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;API（グローバル）: &lt;a href=&quot;https://jestjs.io/docs/api&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://jestjs.io/docs/api&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;API（&lt;code&gt;expect&lt;/code&gt;）: &lt;a href=&quot;https://jestjs.io/docs/expect&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://jestjs.io/docs/expect&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;設定: &lt;a href=&quot;https://jestjs.io/docs/configuration&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://jestjs.io/docs/configuration&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;CLI: &lt;a href=&quot;https://jestjs.io/docs/cli&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://jestjs.io/docs/cli&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-06-11-cloudflare-direct-upload</id>
<title type="text">Cloudflare Pagesのダイレクトアップロードでビルド済みの静的サイトをそのままデプロイする</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-06-11-cloudflare-direct-upload" />
<published>2022-06-11T20:34:02.771Z</published>
<updated>2022-06-11T20:34:02.771Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Cloudflare Pages" />
<content type="html">&lt;p&gt;Cloudflare PagesでCIやローカルからビルド済みのコンテンツをそのままアップロードするには「&lt;a href=&quot;https://developers.cloudflare.com/pages/platform/direct-upload/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;ダイレクトアップロード&lt;/a&gt;」を使う。&lt;/p&gt;
&lt;p&gt;ドラッグ&amp;#x26;ドロップによるアップロードもできるが、&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developers.cloudflare.com/pages/platform/direct-upload/#drag-and-drop&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developers.cloudflare.com/pages/platform/direct-upload/#drag-and-drop&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;ここではWranglerを使った方法を紹介する。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developers.cloudflare.com/pages/platform/direct-upload/#wrangler-cli&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developers.cloudflare.com/pages/platform/direct-upload/#wrangler-cli&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;wrangler&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#wrangler&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;Wrangler&lt;/h2&gt;
&lt;p&gt;現在のバージョンは、&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,d3JhbmdsZXIgLS12ZXJzaW9u&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;wrangler&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --version&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;text&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;text&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.text&quot; href=&quot;data:text/plain;charset=utf-8;base64,Mi4wLjk=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;2.0.9&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;もしWrangler 1を使っている場合は、Wrangler 2に移行する必要がある。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,IyBXcmFuZ2xlciAxCm5wbSB1bmluc3RhbGwgLWcgQGNsb3VkZmxhcmUvd3JhbmdsZXIKIyBXcmFuZ2xlciAyCm5wbSBpbnN0YWxsIC1nIHdyYW5nbGVy&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Wrangler 1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; uninstall&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -g&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; @cloudflare/wrangler&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Wrangler 2&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -g&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; wrangler&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developers.cloudflare.com/workers/wrangler/migration/migrating-from-wrangler-1/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developers.cloudflare.com/workers/wrangler/migration/migrating-from-wrangler-1/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;アップロード&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#アップロード&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;アップロード&lt;/h2&gt;
&lt;p&gt;アップロードは次のコマンドで行う。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,d3JhbmdsZXIgcGFnZXMgcHVibGlzaCBbRElSRUNUT1JZXSBbT1BUSU9OU10=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;wrangler&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; pages&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; publish&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [DIRECTORY] [OPTIONS]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;dist&lt;/code&gt;ディレクトリをアップロードしたい場合は、&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,d3JhbmdsZXIgcGFnZXMgcHVibGlzaCBkaXN0&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;wrangler&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; pages&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; publish&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; dist&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;新しくデプロイする場合は、プロンプトでまずプロジェクトを作成することになる。&lt;/p&gt;
&lt;p&gt;既存のプロジェクト名を指定したい場合は、&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,d3JhbmdsZXIgcGFnZXMgcHVibGlzaCBkaXN0IC0tcHJvamVjdC1uYW1lIG15LXByb2plY3Q=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;wrangler&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; pages&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; publish&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; dist&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --project-name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; my-project&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;プロジェクト&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#プロジェクト&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;プロジェクト&lt;/h2&gt;
&lt;p&gt;既存のプロジェクトを確認するには、&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,d3JhbmdsZXIgcGFnZXMgcHJvamVjdCBsaXN0&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;wrangler&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; pages&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; project&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; list&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;プロジェクトを作成するには、&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,d3JhbmdsZXIgcGFnZXMgcHJvamVjdCBjcmVhdGUgW1BST0pFQ1QtTkFNRV0gW09QVElPTlNd&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;wrangler&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; pages&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; project&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; create&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [PROJECT-NAME] [OPTIONS]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;例えば&lt;code&gt;my-project&lt;/code&gt;という名前のプロジェクトを作成するには、&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,d3JhbmdsZXIgcGFnZXMgcHJvamVjdCBjcmVhdGUgbXktcHJvamVjdA==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;wrangler&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; pages&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; project&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; create&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; my-project&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;さらにプロダクション用のブランチ名を指定するには、&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,d3JhbmdsZXIgcGFnZXMgcHJvamVjdCBjcmVhdGUgbXktcHJvamVjdCAtLXByb2R1Y3Rpb24tYnJhbmNoIG1haW4=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;wrangler&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; pages&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; project&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; create&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; my-project&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --production-branch&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; main&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;参考リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#参考リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;参考リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developers.cloudflare.com/workers/wrangler/commands/#pages&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developers.cloudflare.com/workers/wrangler/commands/#pages&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developers.cloudflare.com/pages/platform/direct-upload/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developers.cloudflare.com/pages/platform/direct-upload/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://blog.cloudflare.com/cloudflare-pages-direct-uploads/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://blog.cloudflare.com/cloudflare-pages-direct-uploads/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-05-29-cargo-resolver-2</id>
<title type="text">RustでCargoの仮想ワークスペース（virtual workspaces）使用時にのみ依存パッケージのコンパイルに失敗する</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-05-29-cargo-resolver-2" />
<published>2022-05-29T09:24:05.542Z</published>
<updated>2022-05-29T09:24:05.542Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Rust" /><category term="Cargo" /><category term="Bevy" />
<content type="html">&lt;p&gt;Rustでゲームエンジンの&lt;a href=&quot;https://bevyengine.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Bevy&lt;/a&gt;を使ってパッケージとして書いていたものをワークスペースに移行してビルドしてみると、なぜか突然依存パッケージのコンパイルに失敗するようになった。&lt;/p&gt;
&lt;p&gt;調べてみると仮想ワークスペースではパッケージのようにエディションを指定しないので、依存関係の解決アルゴリズムに古いバージョンのものがデフォルトで使われてしまうことが原因のようで、&lt;code&gt;resolver = &quot;2&quot;&lt;/code&gt;を指定すると解決した。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;toml&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;toml&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.toml&quot; href=&quot;data:text/plain;charset=utf-8;base64,W3dvcmtzcGFjZV0KbWVtYmVycyA9IFsiY3JhdGVzLyoiXQpyZXNvbHZlciA9ICIyIg==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-toml&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;workspace&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;members = [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;crates/*&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;resolver = &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;2&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;なお解決したあとで検索してみるとBevyの非公式チートブックにもよくある落とし穴としてしっかり記載されていた。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://bevy-cheatbook.github.io/pitfalls/build-errors.html#multi-crate-workspaces&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://bevy-cheatbook.github.io/pitfalls/build-errors.html#multi-crate-workspaces&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-05-26-storybook-react-mdx-not-function</id>
<title type="text">Storybook + React + MDX で TypeError `(0 , _mdx_js_react__WEBPACK_IMPORTED_MODULE_2__.mdx) is not a function` が出る</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-05-26-storybook-react-mdx-not-function" />
<published>2022-05-26T12:55:50.409Z</published>
<updated>2022-05-26T12:55:50.409Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Storybook" />
<content type="html">&lt;p&gt;Storybookの構築時にハマったのでメモ。ビルドは正常にされるが、Storybookを開いた時に次のようなTypeErrorが出た。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;text&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;text&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.text&quot; href=&quot;data:text/plain;charset=utf-8;base64,KDAgLCBfbWR4X2pzX3JlYWN0X19XRUJQQUNLX0lNUE9SVEVEX01PRFVMRV8yX18ubWR4KSBpcyBub3QgYSBmdW5jdGlvbg==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;(0 , _mdx_js_react__WEBPACK_IMPORTED_MODULE_2__.mdx) is not a function&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;原因はどうやらMDX 2を使っていたことのようだったので、&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://storybook.js.org/docs/react/writing-docs/mdx#mdx-2&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://storybook.js.org/docs/react/writing-docs/mdx#mdx-2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;に書かれている通り、&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bnBtIGluc3RhbGwgQHN0b3J5Ym9vay9tZHgyLWNzZiAtLXNhdmUtZGV2&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; @storybook/mdx2-csf&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --save-dev&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;.storybook/main.js&lt;/code&gt;:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;js&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;js&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.js&quot; href=&quot;data:text/plain;charset=utf-8;base64,bW9kdWxlLmV4cG9ydHMgPSB7CiAgICAvLyAuLi4KICAgIGZlYXR1cmVzOiB7CiAgICAgICAgcHJldmlld01keDI6IHRydWUsCiAgICB9LAp9&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;module&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;exports&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;    // ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    features: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        previewMdx2: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;を追加すると解決した。&lt;/p&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/storybook</id>
<title type="text">Storybook</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/storybook" />
<published>2022-05-26T12:55:50.409Z</published>
<updated>2022-05-26T12:55:50.409Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式サイト: &lt;a href=&quot;https://storybook.js.org&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://storybook.js.org&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;リポジトリ: &lt;a href=&quot;https://github.com/storybookjs/storybook/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/storybookjs/storybook/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-05-14-ffmpeg-video-to-gif</id>
<title type="text">FFmpegで動画をGIF化する</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-05-14-ffmpeg-video-to-gif" />
<published>2022-05-14T23:01:59.795Z</published>
<updated>2022-05-14T23:01:59.795Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="FFmpeg" /><category term="GIF" />
<content type="html">&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZmZtcGVnIC1pIHZpZGVvLm1vdiB2aWRlby5naWY=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;ffmpeg&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -i&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; video.mov&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; video.gif&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;フレームレートは&lt;code&gt;-r&lt;/code&gt;で、サイズは&lt;code&gt;-vf scale=&lt;/code&gt;で指定できる。&lt;code&gt;-1&lt;/code&gt;はアスペクト比を保つという意味。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZmZtcGVnIC1pIHZpZGVvLm1vdiAtciAzMCAtdmYgc2NhbGU9MTI4MDotMSB2aWRlby5naWY=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;ffmpeg&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -i&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; video.mov&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -r&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 30&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -vf&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; scale=1280:-1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; video.gif&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/ffmpeg</id>
<title type="text">FFmpeg</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/ffmpeg" />
<published>2022-05-14T23:01:59.795Z</published>
<updated>2022-05-14T23:01:59.795Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式サイト: &lt;a href=&quot;https://ffmpeg.org&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://ffmpeg.org&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/gif</id>
<title type="text">GIF</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/gif" />
<published>2022-05-14T23:01:59.795Z</published>
<updated>2022-05-14T23:01:59.795Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;p&gt;Graphics Interchange Formatの略。設計者（Steve Wilhite）による読み方は「ジフ」。&lt;/p&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-05-10-netlify-local-deploy</id>
<title type="text">Netlifyでローカルビルドをそのまま静的ホストする</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-05-10-netlify-local-deploy" />
<published>2022-05-10T02:47:01.890Z</published>
<updated>2022-06-11T20:34:02.771Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Netlify" />
<content type="html">&lt;p&gt;&lt;a href=&quot;https://www.netlify.com&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Netlify&lt;/a&gt;の手動デプロイを使うと、ブラウザまたはCLIからフォルダをアップロードして静的ホストすることができる。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.netlify.com&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.netlify.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;ブラウザ（各種メニューの「手動デプロイ」、&lt;a href=&quot;https://app.netlify.com/drop&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Netlify Drop&lt;/a&gt;）からデプロイすることもできるが、ここでは&lt;a href=&quot;https://cli.netlify.com&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Netlify CLI&lt;/a&gt;を使う。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/netlify/cli/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/netlify/cli/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;インストール&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#インストール&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;インストール&lt;/h2&gt;
&lt;p&gt;今回はCI環境では使わないので、グローバルインストールする。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bnBtIGluc3RhbGwgbmV0bGlmeS1jbGkgLWc=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; netlify-cli&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -g&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;もしCI環境でもNetlify CLIを使うのであれば、開発依存パッケージとしてインストールする。（ビルドには別のCIサービスを使い、デプロイ先だけNetlifyにしたいような場合に便利。）&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bnBtIGluc3RhbGwgLS1zYXZlLWRldiBuZXRsaWZ5LWNsaQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --save-dev&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; netlify-cli&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;コマンドが実行できるかを確認するには次を実行する。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bmV0bGlmeQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;netlify&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;ログイン&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ログイン&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;ログイン&lt;/h2&gt;
&lt;p&gt;現在の環境でログインするには次を実行する。実行するとブラウザが開く。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bmV0bGlmeSBsb2dpbg==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;netlify&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; login&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;ログイン情報はユーザーディレクトリ以下の次の場所にある&lt;a href=&quot;https://docs.netlify.com/cli/get-started/#config-json-location&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;config.json&lt;/code&gt;&lt;/a&gt;に保存される。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;macOS: &lt;code&gt;Library/Preferences/netlify/config.json&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Linux: &lt;code&gt;.config/netlify/config.json&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Windows: &lt;code&gt;AppData\Roaming\netlify\Config\config.json&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;なおアカウントを切り替えるには次を実行する。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bmV0bGlmeSBzd2l0Y2g=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;netlify&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; switch&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;デプロイ&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#デプロイ&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;デプロイ&lt;/h2&gt;
&lt;p&gt;デプロイには&lt;code&gt;netlify deploy&lt;/code&gt;コマンドを使う。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bmV0bGlmeSBkZXBsb3k=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;netlify&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; deploy&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;何もなしで実行するとカレントディレクトリの中身全てをそのままプレビュー環境にデプロイすることになる。ちなみに初回実行時はディレクトリとサイトが結び付けられていないので、コマンドライン上のプロンプトでサイトを作成または選択することになる。&lt;/p&gt;
&lt;p&gt;多くの場合プロジェクトのルートディレクトリにカレントディレクトリがあり、その下にあるビルドディレクトリをアップロードすることになると思う。そのような場合、&lt;code&gt;--dir&lt;/code&gt;オプションと使うとアップロードするディレクトリを指定できる。例えばビルドディレクトリがカレントディレクトリの&lt;code&gt;./dist&lt;/code&gt;にあるとすると次のようになる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bmV0bGlmeSBkZXBsb3kgLS1kaXI9ZGlzdA==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;netlify&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; deploy&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --dir=dist&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;上記を実行してもデプロイ先はプレビュー環境になる。本番環境にデプロイし公開したい場合は&lt;code&gt;--prod&lt;/code&gt;オプションをつける。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bmV0bGlmeSBkZXBsb3kgLS1kaXI9ZGlzdCAtLXByb2Q=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;netlify&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; deploy&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --dir=dist&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --prod&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;もちろんカレントディレクトリの中身全てを公開したい場合は、&lt;code&gt;--dir&lt;/code&gt;を省けばよい。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bmV0bGlmeSBkZXBsb3kgLS1wcm9k&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;netlify&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; deploy&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --prod&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;既存のサイトに対して手動デプロイを行う場合は、&lt;code&gt;--site&lt;/code&gt;オプションでサイト名またはサイトIDを指定してアップロードすることもできる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bmV0bGlmeSBkZXBsb3kgLS1kaXI9ZGlzdCAtLXNpdGU9bXktc2l0ZSAtLXByb2Q=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;netlify&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; deploy&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --dir=dist&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --site=my-site&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --prod&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;既存のサイトの一覧は次のコマンドで確認できる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bmV0bGlmeSBzaXRlczpsaXN0&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;netlify&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; sites:list&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;既存サイトとのリンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#既存サイトとのリンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;既存サイトとのリンク&lt;/h2&gt;
&lt;p&gt;サイトの設定はディレクトリ内の&lt;code&gt;.netlify/state.json&lt;/code&gt;に保持される。&lt;/p&gt;
&lt;p&gt;サイトとディレクトリを結び付けるには次を実行する。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bmV0bGlmeSBsaW5r&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;netlify&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; link&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;上記のように何もオプションを指定しないと、プロンプトでサイトを選択することになる。&lt;/p&gt;
&lt;p&gt;サイト名を使って結び付けたい場合は、次のように&lt;code&gt;--name&lt;/code&gt;オプションを使用する。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bmV0bGlmeSBsaW5rIC0tbmFtZSBteS1zaXRl&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;netlify&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; link&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; my-site&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;なお先述の通り、既存サイトの一覧は次のコマンドで確認できる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bmV0bGlmeSBzaXRlczpsaXN0&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;netlify&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; sites:list&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;逆にリンクを解除したい場合は、次を実行する。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bmV0bGlmeSB1bmxpbms=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;netlify&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; unlink&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;新規サイトの作成&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#新規サイトの作成&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;新規サイトの作成&lt;/h2&gt;
&lt;p&gt;新しくサイトを作成してディレクトリとリンクするには、次のコマンドを実行する。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bmV0bGlmeSBzaXRlczpjcmVhdGU=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;netlify&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; sites:create&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;サイト名を指定して作成するには、&lt;code&gt;--name&lt;/code&gt;オプションを使用する。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bmV0bGlmeSBzaXRlczpjcmVhdGUgLS1uYW1lIG15LXNpdGU=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;netlify&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; sites:create&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; my-site&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;参考リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#参考リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;参考リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/netlify/cli/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/netlify/cli/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.netlify.com/cli/get-started/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://docs.netlify.com/cli/get-started/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://cli.netlify.com&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://cli.netlify.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;変更履歴&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#変更履歴&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;変更履歴&lt;/h2&gt;
&lt;h3 id=&quot;2022-06-12&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#2022-06-12&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;2022-06-12&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Cloudflare Pagesでも「&lt;a href=&quot;https://developers.cloudflare.com/pages/platform/direct-upload/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;ダイレクトアップロード&lt;/a&gt;」ができるように&lt;a href=&quot;https://blog.cloudflare.com/cloudflare-pages-direct-uploads/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;なっていた&lt;/a&gt;ので、できないとしていた記述を改訂。&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/netlify</id>
<title type="text">Netlify</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/netlify" />
<published>2022-05-10T02:47:01.890Z</published>
<updated>2022-05-10T02:47:01.890Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式サイト: &lt;a href=&quot;https://www.netlify.com&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.netlify.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Netlify CLI: &lt;a href=&quot;https://cli.netlify.com&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://cli.netlify.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Netlify Docs: &lt;a href=&quot;https://docs.netlify.com&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://docs.netlify.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-04-30-bevy-coordinate-system</id>
<title type="text">Bevyの座標系</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-04-30-bevy-coordinate-system" />
<published>2022-05-02T21:25:43.713Z</published>
<updated>2022-05-02T21:25:43.713Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Rust" /><category term="Bevy" /><category term="3D" />
<content type="html">&lt;p&gt;Bevyでは座標系として、Y軸上向きの右手系が使われている。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://blog.publictheta.com/uploads/p9KAaQGQaaTTc1yAv5IGB/y-up-right-handed.svg&quot; alt=&quot;Y軸上向き右手座標系&quot;&gt;&lt;/p&gt;
&lt;p&gt;これはMayaやGodot、Minecraftなどとは同じだが、UnityとはZ軸の正負が逆となっている。&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;軸&lt;/th&gt;
&lt;th&gt;符号&lt;/th&gt;
&lt;th&gt;向き&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;X&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;右&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;X&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;左&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Y&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;上&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Y&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;下&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Z&lt;/td&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;後&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Z&lt;/td&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;前&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id=&quot;参考リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#参考リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;参考リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/bevyengine/bevy/discussions/1979&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/bevyengine/bevy/discussions/1979&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/bevyengine/bevy/blob/main/crates/bevy_transform/src/components/transform.rs&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/bevyengine/bevy/blob/main/crates/bevy_transform/src/components/transform.rs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.rs/bevy/latest/bevy/transform/components/struct.Transform.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://docs.rs/bevy/latest/bevy/transform/components/struct.Transform.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://bevy-cheatbook.github.io/features/coords.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://bevy-cheatbook.github.io/features/coords.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/3d</id>
<title type="text">3D</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/3d" />
<published>2022-05-02T21:25:43.713Z</published>
<updated>2022-05-02T21:25:43.713Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html"></content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/bevy</id>
<title type="text">Bevy</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/bevy" />
<published>2022-05-02T21:25:43.713Z</published>
<updated>2022-05-02T21:25:43.713Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式サイト: &lt;a href=&quot;https://bevyengine.org&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://bevyengine.org&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;公式ブック: &lt;a href=&quot;https://bevyengine.org/learn/book/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://bevyengine.org/learn/book/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;リポジトリ: &lt;a href=&quot;https://github.com/bevyengine/bevy&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/bevyengine/bevy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;docs.rs&lt;/code&gt;: &lt;a href=&quot;https://docs.rs/bevy/latest/bevy/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://docs.rs/bevy/latest/bevy/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;チートブック: &lt;a href=&quot;https://bevy-cheatbook.github.io/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://bevy-cheatbook.github.io/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-04-11-vscode-side-load-extension</id>
<title type="text">`vscode.dev`に開発中の拡張機能をローカルから読み込む</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-04-11-vscode-side-load-extension" />
<published>2022-04-11T17:39:44.728Z</published>
<updated>2022-04-11T17:39:44.728Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="VS Code" /><category term="VS Code拡張機能" />
<content type="html">&lt;p&gt;&lt;a href=&quot;https://vscode.dev/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;vscode.dev&lt;/code&gt;&lt;/a&gt;では、ローカルで開発中の拡張機能をマーケットプレイスなどに公開することなく、実際にインストールして試すことができる。&lt;/p&gt;
&lt;p&gt;仕組みとしては、ローカルサーバーでホストした拡張機能を&lt;a href=&quot;https://github.com/localtunnel/localtunnel&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;localtunnel&lt;/code&gt;&lt;/a&gt;を使ってグローバルにアクセスできるようにし、それを&lt;code&gt;vscode.dev&lt;/code&gt;の&lt;code&gt;Developer: Install Web Extension&lt;/code&gt;コマンドによってサイドロードする、という流れになっている。&lt;/p&gt;
&lt;p&gt;なお、&lt;code&gt;localtunnel&lt;/code&gt;によるトンネリングに使うサーバーにはデフォルトで&lt;code&gt;https://localtunnel.me&lt;/code&gt;が使われるようになっているが、自前でホストすることも&lt;a href=&quot;https://github.com/localtunnel/server&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;可能&lt;/a&gt;。もちろんトンネリングには別のツールを使ってもいいのだが、VS Codeの公式ドキュメントで紹介されていたので、ここではそのまま&lt;code&gt;localtunnel&lt;/code&gt;を使うことにする。&lt;/p&gt;
&lt;h2 id=&quot;方法&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#方法&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;方法&lt;/h2&gt;
&lt;p&gt;ローカルサーバーのポート番号としてここでは&lt;code&gt;8080&lt;/code&gt;を使うことにする。&lt;/p&gt;
&lt;p&gt;まずターミナルを一つ開いてローカルサーバーを立ち上げ拡張機能をホストする（ビルドが必要な場合あらかじめビルドしておく）:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bnB4IHNlcnZlIC0tY29ycyAtbCA4MDgw&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; serve&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --cors&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -l&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 8080&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;次に別のターミナルを開いてトンネリングを開始する:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bnB4IGxvY2FsdHVubmVsIC1wIDgwODA=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; localtunnel&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -p&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 8080&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;ここで発行される次のようなURLをコピーしてメモしておく:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;text&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;text&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.text&quot; href=&quot;data:text/plain;charset=utf-8;base64,eW91ciB1cmwgaXM6IGh0dHBzOi8vaHVuZ3J5LW1vbGUtNDgubG9jYS5sdC8=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;your url is: https://hungry-mole-48.loca.lt/&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;まずURLブラウザでこのURLを開き、そこで表示される&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;text&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;text&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.text&quot; href=&quot;data:text/plain;charset=utf-8;base64,Q2xpY2sgdG8gQ29udGludWU=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Click to Continue&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;という青いボタンを、注意を読んだ上で押す。&lt;/p&gt;
&lt;p&gt;あとは&lt;code&gt;vscode.dev&lt;/code&gt;のコマンドパレットから:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;text&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;text&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.text&quot; href=&quot;data:text/plain;charset=utf-8;base64,RGV2ZWxvcGVyOiBJbnN0YWxsIFdlYiBFeHRlbnNpb24uLi4=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Developer: Install Web Extension...&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;を実行し、発行されたURLを入力欄にペーストしてEnterすると、拡張機能の読み込みが実行される。&lt;/p&gt;
&lt;h2 id=&quot;参考リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#参考リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;参考リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式ドキュメント: Web Extensions - Test your web extension in on vscode.dev
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://code.visualstudio.com/api/extension-guides/web-extensions#test-your-web-extension-in-on-vscode.dev&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://code.visualstudio.com/api/extension-guides/web-extensions#test-your-web-extension-in-on-vscode.dev&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/vscode</id>
<title type="text">VS Code</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/vscode" />
<published>2022-04-11T17:39:44.728Z</published>
<updated>2022-04-11T17:39:44.728Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式サイト: &lt;a href=&quot;https://code.visualstudio.com/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://code.visualstudio.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;リポジトリ: &lt;a href=&quot;https://github.com/microsoft/vscode&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/microsoft/vscode&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/vscode-extension</id>
<title type="text">VS Code拡張機能</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/vscode-extension" />
<published>2022-04-11T17:39:44.728Z</published>
<updated>2022-04-11T17:39:44.728Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式ドキュメンテーション: &lt;a href=&quot;https://code.visualstudio.com/api&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://code.visualstudio.com/api&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/articles/2022-04-03-typescript-iterator-generator</id>
<title type="text">TypeScriptのイテレーターとジェネレーター</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/articles/2022-04-03-typescript-iterator-generator" />
<published>2022-04-04T02:08:06.486Z</published>
<updated>2022-04-04T02:08:06.486Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="TypeScript" />
<content type="html">&lt;h2 id=&quot;ecmascriptの反復処理インターフェース&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ecmascriptの反復処理インターフェース&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;ECMAScriptの反復処理インターフェース&lt;/h2&gt;
&lt;p&gt;ECMAScript（現行: 2023）では、反復処理（iteration）のためのインターフェースとして、&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterable-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Iterable&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterator-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Iterator&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asynciterable-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;AsyncIterable&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asynciterator-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;AsyncIterator&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iteratorresult-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;IteratorResult&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;の5つが定義されている。&lt;/p&gt;
&lt;h3 id=&quot;iterable&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#iterable&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;Iterable&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterable-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Iterable&lt;/code&gt;&lt;/a&gt;は、&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterator-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Iterator&lt;/code&gt;&lt;/a&gt;にしたがうオブジェクトを返す関数&lt;code&gt;@@iterator&lt;/code&gt;（&lt;a href=&quot;https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-symbol.iterator&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Symbol.iterator&lt;/code&gt;&lt;/a&gt;）をプロパティとして必ず持つことを示すインターフェースである。&lt;/p&gt;
&lt;p&gt;TypeScriptではそのまま次のように定義されている。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/microsoft/TypeScript/blob/b1a25fd8b1adec4514809d54d96b64069887652c/src/lib/es2015.iterable.d.ts#L30-L32&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;src/lib/es2015.iterable.d.ts#L30-L32&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,aW50ZXJmYWNlIEl0ZXJhYmxlPFQ+IHsKICAgIFtTeW1ib2wuaXRlcmF0b3JdKCk6IEl0ZXJhdG9yPFQ+Owp9&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Iterable&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    [Symbol.iterator]()&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Iterator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;※引用するコードにもともとあったコメントは省略してある。以下同様。&lt;/p&gt;
&lt;p&gt;この&lt;code&gt;@@iterator&lt;/code&gt;は、&lt;code&gt;for...of&lt;/code&gt;文、&lt;code&gt;yield*&lt;/code&gt;式、&lt;code&gt;...&lt;/code&gt;演算子などを使った際にも暗黙的に呼ばれる（抽象操作&lt;a href=&quot;https://tc39.es/ecma262/multipage/abstract-operations.html#sec-getiterator&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;GetIterator&lt;/code&gt;&lt;/a&gt;を参照）。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,Zm9yIChjb25zdCBpdGVtIG9mIFsxLCAyLCAzLCA0XSkgewogICAgY29uc29sZS5sb2coaXRlbSkKfQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; item&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; of&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    console.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(item)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h3 id=&quot;asynciterable&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#asynciterable&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;AsyncIterable&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asynciterable-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;AsyncIterable&lt;/code&gt;&lt;/a&gt;は、&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterable-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Iterable&lt;/code&gt;&lt;/a&gt;の非同期版で、&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asynciterator-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;AsyncIterator&lt;/code&gt;&lt;/a&gt;にしたがうオブジェクトを返す関数&lt;code&gt;@@asyncIterator&lt;/code&gt;（&lt;a href=&quot;https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-symbol.asynciterator&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Symbol.asyncIterator&lt;/code&gt;&lt;/a&gt;）をプロパティとして必ず持つことを示すインターフェースである。&lt;/p&gt;
&lt;p&gt;こちらもTypeScriptではそのまま次のように定義されている。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/microsoft/TypeScript/blob/b1a25fd8b1adec4514809d54d96b64069887652c/src/lib/es2018.asynciterable.d.ts#L19-L21&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;src/lib/es2018.asynciterable.d.ts#L19-L21&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,aW50ZXJmYWNlIEFzeW5jSXRlcmFibGU8VD4gewogICAgW1N5bWJvbC5hc3luY0l0ZXJhdG9yXSgpOiBBc3luY0l0ZXJhdG9yPFQ+Owp9&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; AsyncIterable&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    [Symbol.asyncIterator]()&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; AsyncIterator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;この&lt;code&gt;@@asyncIterator&lt;/code&gt;も、&lt;code&gt;for await...of&lt;/code&gt;文、&lt;code&gt;yield*&lt;/code&gt;式、などを使った際に暗黙的に呼ばれうる（同じく抽象操作&lt;a href=&quot;https://tc39.es/ecma262/multipage/abstract-operations.html#sec-getiterator&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;GetIterator&lt;/code&gt;&lt;/a&gt;を参照）。&lt;/p&gt;
&lt;h3 id=&quot;iterator&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#iterator&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;Iterator&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterator-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Iterator&lt;/code&gt;&lt;/a&gt;は、&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iteratorresult-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;IteratorResult&lt;/code&gt;&lt;/a&gt;を返す関数&lt;code&gt;next&lt;/code&gt;をプロパティとして必ず持ち、オプションとして同じく&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iteratorresult-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;IteratorResult&lt;/code&gt;&lt;/a&gt;を返す関数&lt;code&gt;return&lt;/code&gt;、&lt;code&gt;throw&lt;/code&gt;を持つことを示すインターフェースとなっている。&lt;/p&gt;
&lt;p&gt;TypeScriptでの定義は次のようになっている。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/microsoft/TypeScript/blob/b1a25fd8b1adec4514809d54d96b64069887652c/src/lib/es2015.iterable.d.ts#L23-L28&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;src/lib/es2015.iterable.d.ts#L23-L28&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,aW50ZXJmYWNlIEl0ZXJhdG9yPFQsIFRSZXR1cm4gPSBhbnksIFROZXh0ID0gdW5kZWZpbmVkPiB7CiAgICBuZXh0KC4uLmFyZ3M6IFtdIHwgW1ROZXh0XSk6IEl0ZXJhdG9yUmVzdWx0PFQsIFRSZXR1cm4+OwogICAgcmV0dXJuPyh2YWx1ZT86IFRSZXR1cm4pOiBJdGVyYXRvclJlc3VsdDxULCBUUmV0dXJuPjsKICAgIHRocm93PyhlPzogYW55KTogSXRlcmF0b3JSZXN1bHQ8VCwgVFJldHVybj47Cn0=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Iterator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; any&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TNext&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; undefined&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    next&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;args&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [] &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TNext&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;])&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; IteratorResult&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;?:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; IteratorResult&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    throw&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;?:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; any&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; IteratorResult&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;反復は&lt;code&gt;next&lt;/code&gt;を呼ぶことによって進められる。&lt;code&gt;next&lt;/code&gt;は引数を任意で1つとり、&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iteratorresult-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;IteratorResult&lt;/code&gt;&lt;/a&gt;を返す。ECMAScriptの仕様には、一度&lt;code&gt;done&lt;/code&gt;が&lt;code&gt;true&lt;/code&gt;の&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iteratorresult-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;IteratorResult&lt;/code&gt;&lt;/a&gt;が返されたら、それ以降返される&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iteratorresult-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;IteratorResult&lt;/code&gt;&lt;/a&gt;の&lt;code&gt;done&lt;/code&gt;はすべて&lt;code&gt;true&lt;/code&gt;であるべき旨が書かれているが、一方でこの要求は強制的なものではないとも書かれている。&lt;/p&gt;
&lt;p&gt;またECMAScriptの仕様には、&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterator-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Iterator&lt;/code&gt;&lt;/a&gt;は&lt;code&gt;next&lt;/code&gt;が引数なしで呼ばれることもあることを前提としなければならない旨の注釈も付け加えられてある。TypeScriptでの&lt;code&gt;next&lt;/code&gt;の引数がタプルで表現されているのはそのチェックを厳密にするためであると思われる（省略したソースコード中のコメントにそのような旨が記載されている）。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;return&lt;/code&gt;と&lt;code&gt;throw&lt;/code&gt;はそれぞれ&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterator-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Iterator&lt;/code&gt;&lt;/a&gt;に反復処理の終了やエラーによる中断を知らせるためのもので、ECMAScriptの仕様では、典型的な振る舞いは&lt;code&gt;value&lt;/code&gt;で指定した値を&lt;code&gt;value&lt;/code&gt;として持つ&lt;code&gt;IteratorResult&lt;/code&gt;を返したり、&lt;code&gt;e&lt;/code&gt;で指定した値を&lt;code&gt;throw&lt;/code&gt;したりして、以降の&lt;code&gt;IteratorResult&lt;/code&gt;の&lt;code&gt;done&lt;/code&gt;を&lt;code&gt;true&lt;/code&gt;にすることであるが、実際の振る舞いは&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterator-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Iterator&lt;/code&gt;&lt;/a&gt;がどのように実装されているかに依存するとされている。&lt;/p&gt;
&lt;h3 id=&quot;asynciterator&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#asynciterator&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;AsyncIterator&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asynciterator-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;AsyncIterator&lt;/code&gt;&lt;/a&gt;は、&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterator-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Iterator&lt;/code&gt;&lt;/a&gt;の非同期版で、プロパティとしてもつ関数がすべて、&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iteratorresult-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;IteratorResult&lt;/code&gt;&lt;/a&gt;の代わりに&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iteratorresult-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;IteratorResult&lt;/code&gt;&lt;/a&gt;の&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-promise-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Promise&lt;/code&gt;&lt;/a&gt;を返すインターフェスである。&lt;/p&gt;
&lt;p&gt;TypeScriptでの定義は次のようになっている。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/microsoft/TypeScript/blob/b1a25fd8b1adec4514809d54d96b64069887652c/src/lib/es2018.asynciterable.d.ts#L12-L17&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;src/lib/es2018.asynciterable.d.ts#L12-L17&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,aW50ZXJmYWNlIEFzeW5jSXRlcmF0b3I8VCwgVFJldHVybiA9IGFueSwgVE5leHQgPSB1bmRlZmluZWQ+IHsKICAgIG5leHQoLi4uYXJnczogW10gfCBbVE5leHRdKTogUHJvbWlzZTxJdGVyYXRvclJlc3VsdDxULCBUUmV0dXJuPj47CiAgICByZXR1cm4/KHZhbHVlPzogVFJldHVybiB8IFByb21pc2VMaWtlPFRSZXR1cm4+KTogUHJvbWlzZTxJdGVyYXRvclJlc3VsdDxULCBUUmV0dXJuPj47CiAgICB0aHJvdz8oZT86IGFueSk6IFByb21pc2U8SXRlcmF0b3JSZXN1bHQ8VCwgVFJldHVybj4+Owp9&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; AsyncIterator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; any&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TNext&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; undefined&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    next&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;args&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [] &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TNext&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;])&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Promise&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;IteratorResult&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;?:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; PromiseLike&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;)&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Promise&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;IteratorResult&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    throw&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;?:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; any&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Promise&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;IteratorResult&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h3 id=&quot;iteratorresult&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#iteratorresult&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;IteratorResult&lt;/h3&gt;
&lt;p&gt;イテレーターから返される&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iteratorresult-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;IteratorResult&lt;/code&gt;&lt;/a&gt;は、&lt;code&gt;done&lt;/code&gt;と&lt;code&gt;value&lt;/code&gt;の二つの値をプロパティーとして持ちうるインターフェースである。&lt;code&gt;done&lt;/code&gt;は&lt;code&gt;true&lt;/code&gt;または&lt;code&gt;false&lt;/code&gt;、&lt;code&gt;value&lt;/code&gt;は任意のECMAScriptの値をとるが、存在しない可能性もある。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;done&lt;/code&gt;が&lt;code&gt;false&lt;/code&gt;または存在しない場合、&lt;code&gt;value&lt;/code&gt;の値は反復の一要素として解釈される。一方、&lt;code&gt;done&lt;/code&gt;が&lt;code&gt;true&lt;/code&gt;である場合、それは反復の終了を意味し、そのときの&lt;code&gt;value&lt;/code&gt;はイテレーター自体の返却値として解釈される。&lt;/p&gt;
&lt;p&gt;これをTypeScriptでは次のように表現している。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/microsoft/TypeScript/blob/b1a25fd8b1adec4514809d54d96b64069887652c/src/lib/es2015.iterable.d.ts#L11-L21&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;src/lib/es2015.iterable.d.ts#L11-L21&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,aW50ZXJmYWNlIEl0ZXJhdG9yWWllbGRSZXN1bHQ8VFlpZWxkPiB7CiAgICBkb25lPzogZmFsc2U7CiAgICB2YWx1ZTogVFlpZWxkOwp9CgppbnRlcmZhY2UgSXRlcmF0b3JSZXR1cm5SZXN1bHQ8VFJldHVybj4gewogICAgZG9uZTogdHJ1ZTsKICAgIHZhbHVlOiBUUmV0dXJuOwp9Cgp0eXBlIEl0ZXJhdG9yUmVzdWx0PFQsIFRSZXR1cm4gPSBhbnk+ID0gSXRlcmF0b3JZaWVsZFJlc3VsdDxUPiB8IEl0ZXJhdG9yUmV0dXJuUmVzdWx0PFRSZXR1cm4+Ow==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; IteratorYieldResult&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TYield&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;    done&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;?:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; false&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;    value&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; TYield&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; IteratorReturnResult&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;    done&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; true&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;    value&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; IteratorResult&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; any&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; IteratorYieldResult&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; IteratorReturnResult&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;組み込みの反復可能オブジェクト&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#組み込みの反復可能オブジェクト&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;組み込みの反復可能オブジェクト&lt;/h2&gt;
&lt;p&gt;ECMAScriptで定義されている次の組み込みオブジェクトは&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterable-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Iterable&lt;/code&gt;&lt;/a&gt;インターフェースを満たしてる。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/text-processing.html#sec-string-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;String&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/indexed-collections.html#sec-array-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Array&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/indexed-collections.html#sec-typedarray-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;TypedArray&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/keyed-collections.html#sec-map-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Map&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/keyed-collections.html#sec-set-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Set&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;そのため、これらのオブジェクトは、&lt;code&gt;for...of&lt;/code&gt;などで直接反復させることができる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,Zm9yIChjb25zdCBjaGFyIG9mICJhYmMiKSB7CiAgY29uc29sZS5sb2coY2hhcikKfQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; char&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; of&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;abc&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  console.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(char)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;イテレーターの反復可能性&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#イテレーターの反復可能性&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;イテレーターの反復可能性&lt;/h2&gt;
&lt;h3 id=&quot;iterableiterator&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#iterableiterator&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;IterableIterator&lt;/h3&gt;
&lt;p&gt;ECMAScriptで定義されている上記のような&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterator-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Iterator&lt;/code&gt;&lt;/a&gt;を満たすオブジェクトは、そのイテレーター自身（&lt;code&gt;this&lt;/code&gt;）を返す&lt;code&gt;@@iterator&lt;/code&gt;（&lt;a href=&quot;https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-symbol.iterator&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Symbol.iterator&lt;/code&gt;&lt;/a&gt;）をプロパティとして持つプロトタイプ&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-%iteratorprototype%25-object&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;%IteratorPrototype%&lt;/code&gt;&lt;/a&gt;を継承しているため、イテレーター自身も&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterable-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Iterable&lt;/code&gt;&lt;/a&gt;インターフェースを満たしている。&lt;/p&gt;
&lt;p&gt;これをTypeScriptでは次のように再帰的に表現している。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/microsoft/TypeScript/blob/b1a25fd8b1adec4514809d54d96b64069887652c/src/lib/es2015.iterable.d.ts#L34-L36&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;src/lib/es2015.iterable.d.ts#L34-L36&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,aW50ZXJmYWNlIEl0ZXJhYmxlSXRlcmF0b3I8VD4gZXh0ZW5kcyBJdGVyYXRvcjxUPiB7CiAgICBbU3ltYm9sLml0ZXJhdG9yXSgpOiBJdGVyYWJsZUl0ZXJhdG9yPFQ+Owp9&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; IterableIterator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;extends&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Iterator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    [Symbol.iterator]()&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; IterableIterator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;これを使って例えば&lt;code&gt;Array&lt;/code&gt;の&lt;code&gt;interface&lt;/code&gt;の一部は、次のように定義されている。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/microsoft/TypeScript/blob/b1a25fd8b1adec4514809d54d96b64069887652c/src/lib/es2015.iterable.d.ts#L38-L56&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;src/lib/es2015.iterable.d.ts#L38-L56&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,aW50ZXJmYWNlIEFycmF5PFQ+IHsKICAgIFtTeW1ib2wuaXRlcmF0b3JdKCk6IEl0ZXJhYmxlSXRlcmF0b3I8VD47CiAgICBlbnRyaWVzKCk6IEl0ZXJhYmxlSXRlcmF0b3I8W251bWJlciwgVF0+OwogICAga2V5cygpOiBJdGVyYWJsZUl0ZXJhdG9yPG51bWJlcj47CiAgICB2YWx1ZXMoKTogSXRlcmFibGVJdGVyYXRvcjxUPjsKfQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Array&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    [Symbol.iterator]()&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; IterableIterator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    entries&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; IterableIterator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;number&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    keys&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; IterableIterator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;number&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    values&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; IterableIterator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h3 id=&quot;asynciterableiterator&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#asynciterableiterator&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;AsyncIterableIterator&lt;/h3&gt;
&lt;p&gt;ECMAScriptで定義されている&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asynciterator-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;AsyncIterator&lt;/code&gt;&lt;/a&gt;を満たすオブジェクトもまた、そのイテレーター自身（&lt;code&gt;this&lt;/code&gt;）を返す&lt;code&gt;@@asyncIterator&lt;/code&gt;（&lt;a href=&quot;https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-symbol.asynciterator&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Symbol.asyncIterator&lt;/code&gt;&lt;/a&gt;）をプロパティとして持つプロトタイプ&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asynciteratorprototype&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;%AsyncIteratorPrototype%&lt;/code&gt;&lt;/a&gt;を継承しているため、イテレーター自身が&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asynciterable-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;AsyncIterable&lt;/code&gt;&lt;/a&gt;インターフェースを満たすようになっている。&lt;/p&gt;
&lt;p&gt;これもTypeScriptでは同様に次のように再帰的に表現している。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/microsoft/TypeScript/blob/b1a25fd8b1adec4514809d54d96b64069887652c/src/lib/es2018.asynciterable.d.ts#L23-L25&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;src/lib/es2018.asynciterable.d.ts#L23-L25&lt;/a&gt;&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,aW50ZXJmYWNlIEFzeW5jSXRlcmFibGVJdGVyYXRvcjxUPiBleHRlbmRzIEFzeW5jSXRlcmF0b3I8VD4gewogICAgW1N5bWJvbC5hc3luY0l0ZXJhdG9yXSgpOiBBc3luY0l0ZXJhYmxlSXRlcmF0b3I8VD47Cn0=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; AsyncIterableIterator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;extends&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; AsyncIterator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    [Symbol.asyncIterator]()&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; AsyncIterableIterator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;イテレーターと反復可能オブジェクトの作成&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#イテレーターと反復可能オブジェクトの作成&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;イテレーターと反復可能オブジェクトの作成&lt;/h2&gt;
&lt;p&gt;先に挙げたインターフェースを満たすようにオブジェクトを作成すれば、自身でイテレーターや反復可能オブジェクトを作成することもできる。&lt;/p&gt;
&lt;p&gt;たとえば、次のコードは&lt;code&gt;1&lt;/code&gt;から&lt;code&gt;10&lt;/code&gt;を出力する。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,Y29uc3QgT05FX1RPX1RFTiA9IHsKICBbU3ltYm9sLml0ZXJhdG9yXSgpIHsKICAgIGxldCBpID0gMDsKICAgIHJldHVybiB7CiAgICAgIG5leHQ6ICgpID0+IHsKICAgICAgICBpICs9IDE7CiAgICAgICAgcmV0dXJuIGkgPD0gMTAgPyB7CiAgICAgICAgICB2YWx1ZTogaSwKICAgICAgICB9IDogewogICAgICAgICAgZG9uZTogdHJ1ZQogICAgICAgIH0KICAgICAgfQogICAgfQogIH0KfQoKZm9yIChjb25zdCBpIG9mIE9ORV9UT19URU4pIHsKICBjb25zb2xlLmxvZyhpKQp9&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; ONE_TO_TEN&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  [Symbol.iterator]() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; i &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;      next&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: () &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        i &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;+=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;        return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; i &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;&amp;#x3C;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 10&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; ?&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          value: i,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        } &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          done: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;true&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; i&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; of&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; ONE_TO_TEN&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  console.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(i)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;ジェネレーター関数とジェネレーター&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ジェネレーター関数とジェネレーター&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;ジェネレーター関数とジェネレーター&lt;/h2&gt;
&lt;p&gt;組み込みの反復可能オブジェクトのように、&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterator-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Iterator&lt;/code&gt;&lt;/a&gt;でありかつ&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterable-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Iterable&lt;/code&gt;&lt;/a&gt;、あるいは&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asynciterator-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;AsyncIterator&lt;/code&gt;&lt;/a&gt;でありかつ&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asynciterable-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;AsyncIterable&lt;/code&gt;&lt;/a&gt;であるようなイテレーターを作成するために、ECMAScriptではジェネレーター関数というものが用意されている。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-generatorfunction-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;GeneratorFunction&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-generator-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Generator&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asyncgeneratorfunction-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;AsyncGeneratorFunction&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asyncgenerator-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;AsyncGenerator&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-generatorfunction-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;GeneratorFunction&lt;/code&gt;&lt;/a&gt;は、&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterator-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Iterator&lt;/code&gt;&lt;/a&gt;でありかつ&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterable-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Iterable&lt;/code&gt;&lt;/a&gt;なオブジェクト&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-generator-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Generator&lt;/code&gt;&lt;/a&gt;を返す関数であり、&lt;code&gt;function*&lt;/code&gt;を使って定義される。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asyncgeneratorfunction-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;AsyncGeneratorFunction&lt;/code&gt;&lt;/a&gt;はその非同期版で、&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asynciterator-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;AsyncIterator&lt;/code&gt;&lt;/a&gt;でありかつ&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asynciterable-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;AsyncIterable&lt;/code&gt;&lt;/a&gt;なオブジェクト&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asyncgenerator-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;AsyncGenerator&lt;/code&gt;&lt;/a&gt;を返す関数であり、&lt;code&gt;async function*&lt;/code&gt;を使って定義される。&lt;/p&gt;
&lt;p&gt;これらのジェネレーター関数の中では、値を反復の一要素として出力する&lt;code&gt;yield&lt;/code&gt;や、処理を別のジェネレーターや反復可能オブジェクトに委任する&lt;code&gt;yield*&lt;/code&gt;が使えるため、反復処理を柔軟に記述することができる。&lt;/p&gt;
&lt;p&gt;たとえば、&lt;code&gt;ONE_TO_TEN&lt;/code&gt;を定義して作成した&lt;code&gt;1&lt;/code&gt;から&lt;code&gt;10&lt;/code&gt;を出力するコードは、&lt;code&gt;lo&lt;/code&gt;から&lt;code&gt;hi&lt;/code&gt;まで（両端含む）の&lt;code&gt;number&lt;/code&gt;を列挙する&lt;code&gt;range&lt;/code&gt;関数をジェネレーター関数として定義することで、次のように書き直すことができる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZnVuY3Rpb24qIHJhbmdlKGxvOiBudW1iZXIsIGhpOiBudW1iZXIpOiBHZW5lcmF0b3I8bnVtYmVyPiB7CiAgZm9yIChsZXQgaSA9IGxvOyBpIDw9IGhpOyBpKyspIHsKICAgIHlpZWxkIGk7CiAgfQp9Cgpmb3IgKGNvbnN0IGkgb2YgcmFuZ2UoMSwgMTApKSB7CiAgY29uc29sZS5sb2coaSkKfQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;function*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; range&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;lo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;hi&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Generator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;number&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;  for&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; i &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; lo; i &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;&amp;#x3C;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; hi; i&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    yield&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; i;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; i&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; of&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; range&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  console.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(i)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-generator-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Generator&lt;/code&gt;&lt;/a&gt;は、TypeScriptでは次のように定義されている。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/microsoft/TypeScript/blob/b1a25fd8b1adec4514809d54d96b64069887652c/src/lib/es2015.generator.d.ts#L3-L9&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;src/lib/es2015.generator.d.ts#L3-L9&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,aW50ZXJmYWNlIEdlbmVyYXRvcjxUID0gdW5rbm93biwgVFJldHVybiA9IGFueSwgVE5leHQgPSB1bmtub3duPiBleHRlbmRzIEl0ZXJhdG9yPFQsIFRSZXR1cm4sIFROZXh0PiB7CiAgICBuZXh0KC4uLmFyZ3M6IFtdIHwgW1ROZXh0XSk6IEl0ZXJhdG9yUmVzdWx0PFQsIFRSZXR1cm4+OwogICAgcmV0dXJuKHZhbHVlOiBUUmV0dXJuKTogSXRlcmF0b3JSZXN1bHQ8VCwgVFJldHVybj47CiAgICB0aHJvdyhlOiBhbnkpOiBJdGVyYXRvclJlc3VsdDxULCBUUmV0dXJuPjsKICAgIFtTeW1ib2wuaXRlcmF0b3JdKCk6IEdlbmVyYXRvcjxULCBUUmV0dXJuLCBUTmV4dD47Cn0=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Generator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; unknown&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; any&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TNext&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; unknown&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;extends&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Iterator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TNext&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    next&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;args&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [] &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TNext&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;])&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; IteratorResult&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; IteratorResult&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    throw&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; any&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; IteratorResult&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    [Symbol.iterator]()&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Generator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TNext&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;IterableIterator&lt;/code&gt;との違いは、&lt;code&gt;return&lt;/code&gt;と&lt;code&gt;throw&lt;/code&gt;、およびそれらの引数にあった&lt;code&gt;?&lt;/code&gt;がついていない点で、典型的な&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iterator-interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Iterator&lt;/code&gt;&lt;/a&gt;の振る舞いとして先に述べておいた、&lt;code&gt;return&lt;/code&gt;の場合&lt;code&gt;value&lt;/code&gt;をそのまま返して終了し、&lt;code&gt;throw&lt;/code&gt;の場合&lt;code&gt;e&lt;/code&gt;を&lt;code&gt;throw&lt;/code&gt;して終了する、という既定の動作が自動で定義されるようになっている。&lt;/p&gt;
&lt;p&gt;また&lt;code&gt;next&lt;/code&gt;に対して与えた引数は、&lt;code&gt;yield&lt;/code&gt;の返却値として与えられるようになっており、ジェネレーター関数内で受け取れるようになっている。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZnVuY3Rpb24qIG1ha2VMb2dnZXIobGltaXQ6IG51bWJlcik6IEdlbmVyYXRvcjx2b2lkLCB2b2lkLCBzdHJpbmc+IHsKICAgIGZvciAobGV0IGkgPSAwOyBpIDwgbGltaXQ7IGkrKykgewogICAgICAgIGNvbnNvbGUubG9nKHlpZWxkKQogICAgfQp9Cgpjb25zdCBsb2dnZXIgPSBtYWtlTG9nZ2VyKDMpCmxvZ2dlci5uZXh0KCJoZWxsbyIpIC8vICJoZWxsbyIKbG9nZ2VyLm5leHQoImhlbGxvIikgLy8gImhlbGxvIgpsb2dnZXIubmV4dCgiaGVsbG8iKSAvLyAiaGVsbG8iCmxvZ2dlci5uZXh0KCJoZWxsbyIpIC8vIOWHuuWKm+OBleOCjOOBquOBhA==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;function*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; makeLogger&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;limit&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; number&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Generator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    for&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; i &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; i &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; limit; i&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;++&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        console.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;yield&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; logger&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; makeLogger&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;logger.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;next&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;hello&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;// &quot;hello&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;logger.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;next&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;hello&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;// &quot;hello&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;logger.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;next&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;hello&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;// &quot;hello&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;logger.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;next&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;hello&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;// 出力されない&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;async function*&lt;/code&gt;を使って定義される&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asyncgeneratorfunction-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;AsyncGeneratorFunction&lt;/code&gt;&lt;/a&gt;はその非同期版で、返される&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asyncgenerator-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;AsyncGenerator&lt;/code&gt;&lt;/a&gt;はTypeScriptで次のように定義されている。&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/microsoft/TypeScript/blob/b1a25fd8b1adec4514809d54d96b64069887652c/src/lib/es2018.asyncgenerator.d.ts#L3-L9&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;src/lib/es2018.asyncgenerator.d.ts#L3-L9&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,aW50ZXJmYWNlIEFzeW5jR2VuZXJhdG9yPFQgPSB1bmtub3duLCBUUmV0dXJuID0gYW55LCBUTmV4dCA9IHVua25vd24+IGV4dGVuZHMgQXN5bmNJdGVyYXRvcjxULCBUUmV0dXJuLCBUTmV4dD4gewogICAgbmV4dCguLi5hcmdzOiBbXSB8IFtUTmV4dF0pOiBQcm9taXNlPEl0ZXJhdG9yUmVzdWx0PFQsIFRSZXR1cm4+PjsKICAgIHJldHVybih2YWx1ZTogVFJldHVybiB8IFByb21pc2VMaWtlPFRSZXR1cm4+KTogUHJvbWlzZTxJdGVyYXRvclJlc3VsdDxULCBUUmV0dXJuPj47CiAgICB0aHJvdyhlOiBhbnkpOiBQcm9taXNlPEl0ZXJhdG9yUmVzdWx0PFQsIFRSZXR1cm4+PjsKICAgIFtTeW1ib2wuYXN5bmNJdGVyYXRvcl0oKTogQXN5bmNHZW5lcmF0b3I8VCwgVFJldHVybiwgVE5leHQ+Owp9&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;interface&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; AsyncGenerator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; unknown&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; any&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TNext&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; unknown&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;extends&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; AsyncIterator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TNext&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    next&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;...&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;args&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [] &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;|&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TNext&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;])&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Promise&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;IteratorResult&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;value&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; PromiseLike&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;)&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Promise&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;IteratorResult&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    throw&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;e&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; any&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Promise&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;IteratorResult&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    [Symbol.asyncIterator]()&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; AsyncGenerator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TReturn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;TNext&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;これも返される値（および返される値としてあたえる値）が&lt;code&gt;Promise&lt;/code&gt;となっていることを除いて、&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-generator-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Generator&lt;/code&gt;&lt;/a&gt;と同様である。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,YXN5bmMgZnVuY3Rpb24qIGZldGNoQWxsVGV4dCh1cmxzOiBzdHJpbmdbXSk6IEFzeW5jR2VuZXJhdG9yPHN0cmluZz4gewogIGZvciAoY29uc3QgdXJsIG9mIHVybHMpIHsKICAgIGNvbnN0IHJlcyA9IGF3YWl0IGZldGNoKHVybCkKICAgIHlpZWxkIGF3YWl0IHJlcy50ZXh0KCkKICB9Cn0KCmFzeW5jIGZ1bmN0aW9uIG1haW4oKSB7CiAgZm9yIGF3YWl0IChjb25zdCB0ZXh0IG9mIGZldGNoQWxsVGV4dChbXSkpIHsKICAgIGNvbnNvbGUubG9nKHRleHQpCiAgfQp9CgptYWluKCkuY2F0Y2goY29uc29sZS5lcnJvcik=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; function*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; fetchAllText&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;urls&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[])&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; AsyncGenerator&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;string&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;  for&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; url&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; of&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; urls) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; res&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; await&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; fetch&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(url)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    yield&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; await&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; res.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;text&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; function&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; main&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;  for&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; await&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; text&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; of&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; fetchAllText&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;([])) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    console.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(text)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;main&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;catch&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(console.error)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;参考リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#参考リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;参考リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;MDN: JavaScript
&lt;ul&gt;
&lt;li&gt;Guide: Iterators and Generators
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developer.mozilla.org/docs/Web/JavaScript/Guide/Iterators_and_Generators&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Reference: Iteration protocols
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Iteration_protocols&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Reference: &lt;code&gt;function*&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function*&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Reference: &lt;code&gt;function*&lt;/code&gt; expression
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function*&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/function*&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Reference: &lt;code&gt;yield&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/yield&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/yield&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Reference: &lt;code&gt;yield*&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/yield*&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Operators/yield*&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Reference: &lt;code&gt;for...of&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for...of&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Reference: &lt;code&gt;for await...of&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/for-await...of&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Reference: &lt;code&gt;Symbol.iterator&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.or/docs/Web/JavaScript/Reference/Global_Objects/Symbol/iterator&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developer.mozilla.or/docs/Web/JavaScript/Reference/Global_Objects/Symbol/iterator&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Reference: &lt;code&gt;Symbol.asyncIterator&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Symbol/asyncIterator&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Reference: &lt;code&gt;Generator&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Generator&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Reference: &lt;code&gt;GeneratorFunction&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;TypeScript: Documentation
&lt;ul&gt;
&lt;li&gt;Iterators and Generators
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.typescriptlang.org/docs/handbook/iterators-and-generators.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.typescriptlang.org/docs/handbook/iterators-and-generators.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;TypeScript: Source
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;src/lib/es2015.symbol.d.ts&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/microsoft/TypeScript/blob/main/src/lib/es2015.symbol.d.ts&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/microsoft/TypeScript/blob/main/src/lib/es2015.symbol.d.ts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;src/lib/es2015.iterable.d.ts&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/microsoft/TypeScript/blob/main/src/lib/es2015.iterable.d.ts&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/microsoft/TypeScript/blob/main/src/lib/es2015.iterable.d.ts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;src/lib/es2015.generator.d.ts&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/microsoft/TypeScript/blob/main/src/lib/es2015.generator.d.ts&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/microsoft/TypeScript/blob/main/src/lib/es2015.generator.d.ts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;src/lib/es2018.asynciterable.d.ts&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/microsoft/TypeScript/blob/main/src/lib/es2018.asynciterable.d.ts&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/microsoft/TypeScript/blob/main/src/lib/es2018.asynciterable.d.ts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;src/lib/es2018.asyncgenerator.d.ts&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/microsoft/TypeScript/blob/main/src/lib/es2018.asyncgenerator.d.ts&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/microsoft/TypeScript/blob/main/src/lib/es2018.asyncgenerator.d.ts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;ECMAScript® Language Specification
&lt;ul&gt;
&lt;li&gt;6.1.5.1 Well-Known Symbols
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/ecmascript-data-types-and-values.html#sec-well-known-symbols&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://tc39.es/ecma262/multipage/ecmascript-data-types-and-values.html#sec-well-known-symbols&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Table 1: Well-known Symbols
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/ecmascript-data-types-and-values.html#table-well-known-symbols&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://tc39.es/ecma262/multipage/ecmascript-data-types-and-values.html#table-well-known-symbols&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;7.4 Operations on Iterator Objects
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/#sec-operations-on-iterator-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://tc39.es/ecma262/#sec-operations-on-iterator-objects&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;13.15 Assignment Operators
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/#sec-assignment-operators&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://tc39.es/ecma262/#sec-assignment-operators&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;14.7 Iteration Statements
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/ecmascript-language-statements-and-declarations.html#sec-iteration-statements&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://tc39.es/ecma262/multipage/ecmascript-language-statements-and-declarations.html#sec-iteration-statements&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;15.5 Generator Function Definitions
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/ecmascript-language-functions-and-classes.html#sec-generator-function-definitions&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://tc39.es/ecma262/multipage/ecmascript-language-functions-and-classes.html#sec-generator-function-definitions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;15.6 Async Generator Function Definitions
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/ecmascript-language-functions-and-classes.html#sec-async-generator-function-definitions&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://tc39.es/ecma262/multipage/ecmascript-language-functions-and-classes.html#sec-async-generator-function-definitions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;27.1 Iteration
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iteration&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-iteration&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;27.3 GeneratorFunction Objects
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-generatorfunction-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-generatorfunction-objects&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;27.4 AsyncGeneratorFunction Objects
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asyncgeneratorfunction-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asyncgeneratorfunction-objects&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;27.5 Generator Objects
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-generator-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-generator-objects&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;27.6 AsyncGenerator Objects
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asyncgenerator-objects&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://tc39.es/ecma262/multipage/control-abstraction-objects.html#sec-asyncgenerator-objects&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/articles/2022-04-03-notations-intro-algo</id>
<title type="text">計算量の漸近記法（Θ記法・O記法・Ω記法・o記法・ω記法）</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/articles/2022-04-03-notations-intro-algo" />
<published>2022-04-03T17:36:57.843Z</published>
<updated>2022-04-03T17:36:57.843Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="アルゴリズム" /><category term="データ構造" />
<content type="html">&lt;p&gt;『&lt;a href=&quot;https://www.amazon.co.jp/dp/476490408X/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;アルゴリズムイントロダクション 第3版&lt;/a&gt;』（原著: &lt;a href=&quot;https://www.amazon.co.jp/dp/0262033844/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;em&gt;Introduction to Algorithms&lt;/em&gt;&lt;/a&gt;）で用いられている次の5つの漸近記法について、まとめておく。詳細は第3章（総合版でp.36-）を参照。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Θ記法（big-theta notation、上界と下界をあたえる、タイトな限界という）&lt;/li&gt;
&lt;li&gt;O記法（big-o notation、上界のみをあたえる、タイトな限界であるとは限らない）&lt;/li&gt;
&lt;li&gt;Ω記法（big-omega notation、下界のみをあたえる、タイトな限界であるとは限らない）&lt;/li&gt;
&lt;li&gt;o記法（little-o notation、タイトな限界ではない上界をあたえる）&lt;/li&gt;
&lt;li&gt;ω記法（little-omega notation、タイトな限界ではない下界をあたえる）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;たとえば、&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Θ&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 = \Theta(n^2)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Θ&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo mathvariant=&quot;normal&quot;&gt;≠&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Θ&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 \ne \Theta(n^3)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0085em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;span class=&quot;mord vbox&quot;&gt;&lt;span class=&quot;thinbox&quot;&gt;&lt;span class=&quot;rlap&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8889em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;inner&quot;&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;fix&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace nobreak&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Θ&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo mathvariant=&quot;normal&quot;&gt;≠&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Θ&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 \ne \Theta(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0085em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;span class=&quot;mord vbox&quot;&gt;&lt;span class=&quot;thinbox&quot;&gt;&lt;span class=&quot;rlap&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8889em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;inner&quot;&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;fix&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace nobreak&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Θ&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;O&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 = O(n^2)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0278em;&quot;&gt;O&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;O&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 = O(n^3)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0278em;&quot;&gt;O&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 = \Omega(n^2)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 = \Omega(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo mathvariant=&quot;normal&quot;&gt;≠&lt;/mo&gt;&lt;mi&gt;o&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 \ne o(n^2)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0085em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;span class=&quot;mord vbox&quot;&gt;&lt;span class=&quot;thinbox&quot;&gt;&lt;span class=&quot;rlap&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8889em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;inner&quot;&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;fix&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace nobreak&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;o&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 = o(n^3)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo mathvariant=&quot;normal&quot;&gt;≠&lt;/mo&gt;&lt;mi&gt;ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 \ne \omega(n^2)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0085em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;span class=&quot;mord vbox&quot;&gt;&lt;span class=&quot;thinbox&quot;&gt;&lt;span class=&quot;rlap&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8889em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;inner&quot;&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;fix&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace nobreak&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 = \omega(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;θ記法&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#θ記法&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;Θ記法&lt;/h2&gt;
&lt;h3 id=&quot;定義&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#定義&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;定義&lt;/h3&gt;
&lt;p&gt;ある関数 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; について、&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Θ&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\Theta(g(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Θ&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; とは、ある正の定数 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mo separator=&quot;true&quot;&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mo separator=&quot;true&quot;&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;c_1, c_2, n_0&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.625em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mpunct&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.1667em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mpunct&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.1667em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; が存在して、すべての &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo&gt;≥&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;n \ge n_0&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.7719em;vertical-align:-0.136em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≥&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.5806em;vertical-align:-0.15em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; に対して、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo&gt;≤&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;≤&lt;/mo&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;≤&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;0 \le c_1 g(n) \le f(n) \le c_2 g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.7804em;vertical-align:-0.136em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≤&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≤&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≤&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; を満たすような関数 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; の集合である。&lt;/p&gt;
&lt;h3 id=&quot;説明&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#説明&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;説明&lt;/h3&gt;
&lt;p&gt;Θ記法（big-theta notation）は、漸近的な上界と下界をあたえる。&lt;/p&gt;
&lt;p&gt;すなわち、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; が &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Θ&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\Theta(g(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Θ&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; である（属する）とは、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;n&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.4306em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; が十分大きいければ（ &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo&gt;≥&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;≥&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;n \ge n_0 \ge 0&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.7719em;vertical-align:-0.136em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≥&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.786em;vertical-align:-0.15em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≥&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; ）、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; が &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; の定数倍（ &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mn&gt;1&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;c_1 g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; および &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msub&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;c_2 g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; ）につねに挟まれることを意味する。&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo&gt;≥&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;n \ge n_0&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.7719em;vertical-align:-0.136em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≥&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.5806em;vertical-align:-0.15em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; において、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; はつねに &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; と定数倍の範囲で等しくなるので、Θ記法で与えられる &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; を特に、漸近的にタイトな限界（asymptotically tight bound）という。&lt;/p&gt;
&lt;p&gt;たとえば、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Θ&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 = \Theta(n^2)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Θ&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; であるが、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo mathvariant=&quot;normal&quot;&gt;≠&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Θ&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 \ne \Theta(n^3)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0085em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;span class=&quot;mord vbox&quot;&gt;&lt;span class=&quot;thinbox&quot;&gt;&lt;span class=&quot;rlap&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8889em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;inner&quot;&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;fix&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace nobreak&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Θ&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;　、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo mathvariant=&quot;normal&quot;&gt;≠&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Θ&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 \ne \Theta(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0085em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;span class=&quot;mord vbox&quot;&gt;&lt;span class=&quot;thinbox&quot;&gt;&lt;span class=&quot;rlap&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8889em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;inner&quot;&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;fix&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace nobreak&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Θ&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; である。&lt;/p&gt;
&lt;p&gt;（正確には &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;∈&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Θ&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 \in \Theta(n^2)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8532em;vertical-align:-0.0391em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;∈&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Θ&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; だが、このように略記する。詳しくは「等式および不等式における漸近記法」総合版でp.41-を参照。）&lt;/p&gt;
&lt;p&gt;なお、他の文献ではΘ記法の意味でO記法が用いられる場合もある。&lt;/p&gt;
&lt;h2 id=&quot;o記法&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#o記法&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;O記法&lt;/h2&gt;
&lt;h3 id=&quot;定義-1&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#定義-1&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;定義&lt;/h3&gt;
&lt;p&gt;ある関数 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; について、&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;O&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;O(g(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0278em;&quot;&gt;O&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; とは、ある正の定数 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mo separator=&quot;true&quot;&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;c, n_0&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.625em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;mpunct&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.1667em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; が存在して、すべての &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo&gt;≥&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;n \ge n_0&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.7719em;vertical-align:-0.136em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≥&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.5806em;vertical-align:-0.15em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; に対して、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo&gt;≤&lt;/mo&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;≤&lt;/mo&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;0 \le f(n) \le c g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.7804em;vertical-align:-0.136em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≤&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≤&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; を満たすような関数 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; の集合である。&lt;/p&gt;
&lt;h3 id=&quot;説明-1&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#説明-1&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;説明&lt;/h3&gt;
&lt;p&gt;O記法（big-o notation）は、 漸近的な上界をあたえる。&lt;/p&gt;
&lt;p&gt;すなわち &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; が &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;O&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;O(g(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0278em;&quot;&gt;O&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; である（属する）とは、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;n&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.4306em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; が十分大きいければ（ &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo&gt;≥&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;≥&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;n \ge n_0 \ge 0&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.7719em;vertical-align:-0.136em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≥&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.786em;vertical-align:-0.15em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≥&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; ）、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; が &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; の定数倍（ &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;c g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; ）よりつねに小さくなる（上からおさえられる）ことを意味する。&lt;/p&gt;
&lt;p&gt;たとえば、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;O&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 = O(n^2)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0278em;&quot;&gt;O&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; であるが、上界しか示さないので、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;O&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 = O(n^3)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0278em;&quot;&gt;O&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; も成り立つ。&lt;/p&gt;
&lt;p&gt;なお、他の文献ではΘ記法の意味でO記法が用いられる場合もある。&lt;/p&gt;
&lt;h2 id=&quot;ω記法&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ω記法&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;Ω記法&lt;/h2&gt;
&lt;h3 id=&quot;定義-2&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#定義-2&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;定義&lt;/h3&gt;
&lt;p&gt;ある関数 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; について、&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\Omega(g(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; とは、ある正の定数 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mo separator=&quot;true&quot;&gt;,&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;c, n_0&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.625em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;mpunct&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.1667em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; が存在して、すべての &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo&gt;≥&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;n \ge n_0&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.7719em;vertical-align:-0.136em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≥&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.5806em;vertical-align:-0.15em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; に対して、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo&gt;≤&lt;/mo&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;≤&lt;/mo&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;0 \le c g(n) \le f(n) &lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.7804em;vertical-align:-0.136em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≤&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≤&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; を満たすような関数 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; の集合である。&lt;/p&gt;
&lt;h3 id=&quot;説明-2&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#説明-2&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;説明&lt;/h3&gt;
&lt;p&gt;Ω記法（big-omega notation）は、漸近的な下界をあたえる。&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; が &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\Omega(g(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; である（属する）とは、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;n&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.4306em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; が十分大きいければ（ &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo&gt;≥&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;≥&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;n \ge n_0 \ge 0&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.7719em;vertical-align:-0.136em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≥&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.786em;vertical-align:-0.15em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≥&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; ）、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; が &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; の定数倍（ &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;c g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; ）よりつねに大きくなる（下からおさえられる）ことを意味する。&lt;/p&gt;
&lt;p&gt;たとえば、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 = \Omega(n^2)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; であるが、下界しか示さないので、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 = \Omega(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; も成り立つ。&lt;/p&gt;
&lt;h2 id=&quot;o記法-1&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#o記法-1&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;o記法&lt;/h2&gt;
&lt;h3 id=&quot;定義-3&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#定義-3&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;定義&lt;/h3&gt;
&lt;p&gt;ある関数 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; について、&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;o&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;o(g(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; とは、任意の正の定数 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mo&gt;&gt;&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;c \gt 0&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.5782em;vertical-align:-0.0391em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; に対して、ある正の定数 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;&gt;&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;n_0 \gt 0&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.6891em;vertical-align:-0.15em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; が存在して、 すべての &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo&gt;≥&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;n \ge n_0&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.7719em;vertical-align:-0.136em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≥&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.5806em;vertical-align:-0.15em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; に対して &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo&gt;≤&lt;/mo&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;&amp;#x3C;&lt;/mo&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;0 \le f(n) \lt c g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.7804em;vertical-align:-0.136em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≤&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; を満たすような関数 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; の集合である。&lt;/p&gt;
&lt;h3 id=&quot;説明-3&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#説明-3&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;説明&lt;/h3&gt;
&lt;p&gt;o記法（little-o notation）は、漸近的にタイトな限界ではない、漸近的な上界をあたえる。&lt;/p&gt;
&lt;p&gt;すなわち、たとえば &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;o&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;3&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 = o(n^3)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;3&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; であるが、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Θ&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 = \Theta(n^2)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Θ&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; であるため、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo mathvariant=&quot;normal&quot;&gt;≠&lt;/mo&gt;&lt;mi&gt;o&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 \ne o(n^2)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0085em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;span class=&quot;mord vbox&quot;&gt;&lt;span class=&quot;thinbox&quot;&gt;&lt;span class=&quot;rlap&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8889em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;inner&quot;&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;fix&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace nobreak&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; となる。&lt;/p&gt;
&lt;p&gt;o記法では、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;n&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.4306em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; が大きくなるにつれて、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; は &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; に対して相対的に無限小に近づくので、&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;munder&gt;&lt;mrow&gt;&lt;mi&gt;lim&lt;/mi&gt;&lt;mo&gt;⁡&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo&gt;→&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∞&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\lim_{n \to \infty} \frac{f(n)}{g(n)} = 0&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:2.363em;vertical-align:-0.936em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mop op-limits&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.6944em;&quot;&gt;&lt;span style=&quot;top:-2.4em;margin-left:0em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:3em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mrel mtight&quot;&gt;→&lt;/span&gt;&lt;span class=&quot;mord mtight&quot;&gt;∞&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;top:-3em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:3em;&quot;&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;mop&quot;&gt;lim&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.7em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.1667em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:1.427em;&quot;&gt;&lt;span style=&quot;top:-2.314em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:3em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;top:-3.23em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:3em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot; style=&quot;border-bottom-width:0.04em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;top:-3.677em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:3em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.936em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;が成立する。&lt;/p&gt;
&lt;h2 id=&quot;ω記法-1&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ω記法-1&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;ω記法&lt;/h2&gt;
&lt;h3 id=&quot;定義-4&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#定義-4&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;定義&lt;/h3&gt;
&lt;p&gt;ある関数 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; について、&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\omega(g(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; とは、任意の正の定数 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mo&gt;&gt;&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;c \gt 0&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.5782em;vertical-align:-0.0391em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; に対して、ある正の定数 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;msub&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;mo&gt;&gt;&lt;/mo&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;n_0 \gt 0&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.6891em;vertical-align:-0.15em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.6444em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; が存在して、 すべての &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo&gt;≥&lt;/mo&gt;&lt;msub&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;/msub&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;n \ge n_0&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.7719em;vertical-align:-0.136em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≥&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.5806em;vertical-align:-0.15em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.3011em;&quot;&gt;&lt;span style=&quot;top:-2.55em;margin-left:0em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;0&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.15em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; に対して &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;0&lt;/mn&gt;&lt;mo&gt;≤&lt;/mo&gt;&lt;mi&gt;c&lt;/mi&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;&amp;#x3C;&lt;/mo&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;0 \le c g(n) \lt f(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.7804em;vertical-align:-0.136em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≤&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; を満たすような関数 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; の集合である。&lt;/p&gt;
&lt;h3 id=&quot;説明-4&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#説明-4&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;説明&lt;/h3&gt;
&lt;p&gt;ω記法（little-omega notation）は、漸近的にタイトな限界ではない、漸近的な下界をあたえる。&lt;/p&gt;
&lt;p&gt;すなわち、たとえば &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 = \omega(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; であるが、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Θ&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 = \Theta(n^2)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Θ&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; であるため、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo mathvariant=&quot;normal&quot;&gt;≠&lt;/mo&gt;&lt;mi&gt;ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;msup&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mn&gt;2&lt;/mn&gt;&lt;/msup&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;2 n^2 \ne \omega(n^2)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0085em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;span class=&quot;mord vbox&quot;&gt;&lt;span class=&quot;thinbox&quot;&gt;&lt;span class=&quot;rlap&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.8889em;vertical-align:-0.1944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;inner&quot;&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mrel&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;fix&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace nobreak&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1.0641em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;msupsub&quot;&gt;&lt;span class=&quot;vlist-t&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.8141em;&quot;&gt;&lt;span style=&quot;top:-3.063em;margin-right:0.05em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:2.7em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; となる。&lt;/p&gt;
&lt;p&gt;ω記法では、 &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;n&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.4306em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; が小さくなるにつれて &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; は &lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;g(n)&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; に対して相対的に無限大に近づくので、&lt;/p&gt;
&lt;span class=&quot;katex-display&quot;&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot; display=&quot;block&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;munder&gt;&lt;mrow&gt;&lt;mi&gt;lim&lt;/mi&gt;&lt;mo&gt;⁡&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo&gt;→&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∞&lt;/mi&gt;&lt;/mrow&gt;&lt;/munder&gt;&lt;mfrac&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;mrow&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;/mfrac&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;∞&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\lim_{n \to \infty} \frac{f(n)}{g(n)} = \infty&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:2.363em;vertical-align:-0.936em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mop op-limits&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.6944em;&quot;&gt;&lt;span style=&quot;top:-2.4em;margin-left:0em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:3em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sizing reset-size6 size3 mtight&quot;&gt;&lt;span class=&quot;mord mtight&quot;&gt;&lt;span class=&quot;mord mathnormal mtight&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mrel mtight&quot;&gt;→&lt;/span&gt;&lt;span class=&quot;mord mtight&quot;&gt;∞&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;top:-3em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:3em;&quot;&gt;&lt;/span&gt;&lt;span&gt;&lt;span class=&quot;mop&quot;&gt;lim&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.7em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.1667em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mopen nulldelimiter&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mfrac&quot;&gt;&lt;span class=&quot;vlist-t vlist-t2&quot;&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:1.427em;&quot;&gt;&lt;span style=&quot;top:-2.314em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:3em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;top:-3.23em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:3em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;frac-line&quot; style=&quot;border-bottom-width:0.04em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;top:-3.677em;&quot;&gt;&lt;span class=&quot;pstrut&quot; style=&quot;height:3em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-s&quot;&gt;​&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;vlist-r&quot;&gt;&lt;span class=&quot;vlist&quot; style=&quot;height:0.936em;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mclose nulldelimiter&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.4306em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;∞&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;が成立する。&lt;/p&gt;
&lt;h2 id=&quot;漸近関係の性質&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#漸近関係の性質&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;漸近関係の性質&lt;/h2&gt;
&lt;p&gt;推移性は、Θ、O、Ω、o、ωのすべてにおいて成り立つ。すなわち、&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Θ&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;∧&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Θ&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mtext&gt;  &lt;/mtext&gt;&lt;mo&gt;⟹&lt;/mo&gt;&lt;mtext&gt;  &lt;/mtext&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Θ&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n) = \Theta(g(n)) \land g(n) = \Theta(h(n)) \implies f(n) = \Theta(h(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Θ&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;∧&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Θ&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;⟹&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Θ&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;O&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;∧&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;O&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mtext&gt;  &lt;/mtext&gt;&lt;mo&gt;⟹&lt;/mo&gt;&lt;mtext&gt;  &lt;/mtext&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;O&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n) = O(g(n)) \land g(n) = O(h(n)) \implies f(n) = O(h(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0278em;&quot;&gt;O&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;∧&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0278em;&quot;&gt;O&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;⟹&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0278em;&quot;&gt;O&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;∧&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mtext&gt;  &lt;/mtext&gt;&lt;mo&gt;⟹&lt;/mo&gt;&lt;mtext&gt;  &lt;/mtext&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n) = \Omega(g(n)) \land g(n) = \Omega(h(n)) \implies f(n) = \Omega(h(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;∧&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;⟹&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;o&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;∧&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;o&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mtext&gt;  &lt;/mtext&gt;&lt;mo&gt;⟹&lt;/mo&gt;&lt;mtext&gt;  &lt;/mtext&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;o&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n) = o(g(n)) \land g(n) = o(h(n)) \implies f(n) = o(h(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;∧&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;⟹&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;∧&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mtext&gt;  &lt;/mtext&gt;&lt;mo&gt;⟹&lt;/mo&gt;&lt;mtext&gt;  &lt;/mtext&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;h&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n) = \omega(g(n)) \land g(n) = \omega(h(n)) \implies f(n) = \omega(h(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2222em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mbin&quot;&gt;∧&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2222em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;⟹&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;h&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;反射性は、Θ、O、Ωにおいてのみ成り立つ。すなわち、&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Θ&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n) = \Theta(f(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Θ&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;O&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n) = O(f(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0278em;&quot;&gt;O&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n) = \Omega(f(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;対称性は、Θにおいてのみ成り立つ。すなわち、&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Θ&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mtext&gt;  &lt;/mtext&gt;&lt;mo&gt;⟺&lt;/mo&gt;&lt;mtext&gt;  &lt;/mtext&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Θ&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n) = \Theta(g(n)) \iff g(n) = \Theta(f(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Θ&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;⟺&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Θ&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;また、OとΩ、oとωのそれぞれについて転置対称性が成り立つ。すなわち、&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;O&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mtext&gt;  &lt;/mtext&gt;&lt;mo&gt;⟺&lt;/mo&gt;&lt;mtext&gt;  &lt;/mtext&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n) = O(g(n)) \iff g(n) = \Omega(f(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0278em;&quot;&gt;O&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;⟺&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;o&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mtext&gt;  &lt;/mtext&gt;&lt;mo&gt;⟺&lt;/mo&gt;&lt;mtext&gt;  &lt;/mtext&gt;&lt;mi&gt;g&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;ω&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;f&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;(&lt;/mo&gt;&lt;mi&gt;n&lt;/mi&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;mo stretchy=&quot;false&quot;&gt;)&lt;/mo&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;f(n) = o(g(n)) \iff g(n) = \omega(f(n))&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;⟺&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;g&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:1em;vertical-align:-0.25em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;ω&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.1076em;&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;mopen&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;n&lt;/span&gt;&lt;span class=&quot;mclose&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;これらの性質について、実数の同値関係・順序関係と比較すると、&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Θ&lt;/mi&gt;&lt;mo&gt;≈&lt;/mo&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\Theta \approx a = b&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.6833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Θ&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≈&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.4306em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.6944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;b&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;O&lt;/mi&gt;&lt;mo&gt;≈&lt;/mo&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mo&gt;≤&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;O \approx a \le b&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.6833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0278em;&quot;&gt;O&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≈&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.7719em;vertical-align:-0.136em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≤&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.6944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;b&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi mathvariant=&quot;normal&quot;&gt;Ω&lt;/mi&gt;&lt;mo&gt;≈&lt;/mo&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mo&gt;≥&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\Omega \approx a \ge b&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.6833em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord&quot;&gt;Ω&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≈&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.7719em;vertical-align:-0.136em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≥&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.6944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;b&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;o&lt;/mi&gt;&lt;mo&gt;≈&lt;/mo&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mo&gt;&amp;#x3C;&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;o \approx a \lt b&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.4831em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;o&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≈&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.5782em;vertical-align:-0.0391em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.6944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;b&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;katex&quot;&gt;&lt;span class=&quot;katex-mathml&quot;&gt;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;semantics&gt;&lt;mrow&gt;&lt;mi&gt;ω&lt;/mi&gt;&lt;mo&gt;≈&lt;/mo&gt;&lt;mi&gt;a&lt;/mi&gt;&lt;mo&gt;&gt;&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/mrow&gt;&lt;annotation encoding=&quot;application/x-tex&quot;&gt;\omega \approx a \gt b&lt;/annotation&gt;&lt;/semantics&gt;&lt;/math&gt;&lt;/span&gt;&lt;span class=&quot;katex-html&quot; aria-hidden=&quot;true&quot;&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.4831em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot; style=&quot;margin-right:0.0359em;&quot;&gt;ω&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;≈&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.5782em;vertical-align:-0.0391em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;a&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mrel&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;mspace&quot; style=&quot;margin-right:0.2778em;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;base&quot;&gt;&lt;span class=&quot;strut&quot; style=&quot;height:0.6944em;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;mord mathnormal&quot;&gt;b&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;のような類似性が見出されるが、漸近関係についてはかならずしもどれかひとつが成立するとは限らないことに注意。&lt;/p&gt;
&lt;h2 id=&quot;参考&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#参考&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;参考&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;『アルゴリズムイントロダクション 第3版 総合版』2013年、近代科学社
&lt;ul&gt;
&lt;li&gt;原著: &lt;a href=&quot;https://www.amazon.co.jp/dp/0262033844/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;em&gt;Introduction to Algorithms&lt;/em&gt;&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;Thomas H. Cormen&lt;/li&gt;
&lt;li&gt;Charles E. Leiserson&lt;/li&gt;
&lt;li&gt;Ronald L. Rivest&lt;/li&gt;
&lt;li&gt;Clifford Stein&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;翻訳:
&lt;ul&gt;
&lt;li&gt;浅野 哲夫&lt;/li&gt;
&lt;li&gt;岩野 和生&lt;/li&gt;
&lt;li&gt;梅尾 博司&lt;/li&gt;
&lt;li&gt;山下 雅史&lt;/li&gt;
&lt;li&gt;和田 幸一&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;ISBN: &lt;a href=&quot;https://www.amazon.co.jp/dp/476490408X/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;978-4764904088&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/algorithm</id>
<title type="text">アルゴリズム</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/algorithm" />
<published>2022-04-03T17:36:57.843Z</published>
<updated>2022-04-03T17:36:57.843Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html"></content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/data-structure</id>
<title type="text">データ構造</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/data-structure" />
<published>2022-04-03T17:36:57.843Z</published>
<updated>2022-04-03T17:36:57.843Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html"></content>
</entry>
<entry>
<id>https://blog.publictheta.com/articles/2022-04-02-deno-getting-started</id>
<title type="text">Denoをはじめる</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/articles/2022-04-02-deno-getting-started" />
<published>2022-04-02T20:53:03.766Z</published>
<updated>2022-04-02T20:53:03.766Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Deno" /><category term="TypeScript" />
<content type="html">&lt;p&gt;煩雑な設定なしにTypeScriptを実行/テスト/リント/フォーマットできる環境を試してみたかったので、Denoを改めて使ってみる。&lt;/p&gt;
&lt;h2 id=&quot;準備&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#準備&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;準備&lt;/h2&gt;
&lt;p&gt;ここではmacOS/VS Codeで進めていく。&lt;/p&gt;
&lt;h3 id=&quot;denoのインストール&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#denoのインストール&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;Denoのインストール&lt;/h3&gt;
&lt;p&gt;参考リンク: &lt;a href=&quot;https://github.com/denoland/deno_install&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/denoland/deno_install&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;macOSでHomebrewを使う場合は:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,YnJldyBpbnN0YWxsIGRlbm8=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;brew&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; deno&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;公式のインストールスクリプトも用意されている。&lt;/p&gt;
&lt;p&gt;Shell（macOS/Linux）の場合:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,Y3VybCAtZnNTTCBodHRwczovL2Rlbm8ubGFuZC94L2luc3RhbGwvaW5zdGFsbC5zaCB8IHNo&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;curl&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -fsSL&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://deno.land/x/install/install.sh&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; sh&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;PowerShell（Windows）の場合:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,aXdyIGh0dHBzOi8vZGVuby5sYW5kL3gvaW5zdGFsbC9pbnN0YWxsLnBzMSAtdXNlYiB8IGlleA==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;iwr&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://deno.land/x/install/install.ps1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -useb&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; iex&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h3 id=&quot;denoのcli&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#denoのcli&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;DenoのCLI&lt;/h3&gt;
&lt;p&gt;参考リンク: &lt;a href=&quot;https://deno.land/manual/getting_started/command_line_interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://deno.land/manual/getting_started/command_line_interface&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;バージョンの確認は次のコマンドで行う:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZGVubyAtLXZlcnNpb24=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --version&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;更新は次のコマンドで行う:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZGVubyB1cGdyYWRl&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; upgrade&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;ヘルプは次のコマンドで表示される:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZGVubyBoZWxwCmRlbm8gLWgKZGVubyAtLWhlbHA=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; help&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -h&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --help&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h3 id=&quot;denoの設定ファイル&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#denoの設定ファイル&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;Denoの設定ファイル&lt;/h3&gt;
&lt;p&gt;Denoではすべてデフォルトのままで使う場合、設定ファイルは必要ない。ただし、TypeScriptやリンター、フォーマッターの設定を記述したい場合、&lt;code&gt;--config&lt;/code&gt;オプションで渡すことのできる&lt;code&gt;.json&lt;/code&gt;ファイルまたは&lt;code&gt;.jsonc&lt;/code&gt;ファイルを用意しておくことができる。&lt;/p&gt;
&lt;p&gt;デフォルトの名前は決められていないが、将来的なサポートのために&lt;code&gt;deno.json&lt;/code&gt;または&lt;code&gt;deno.jsonc&lt;/code&gt;という名前が推奨されている。&lt;/p&gt;
&lt;h3 id=&quot;ideの設定&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ideの設定&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;IDEの設定&lt;/h3&gt;
&lt;p&gt;参考リンク: &lt;a href=&quot;https://deno.land/manual/getting_started/setup_your_environment&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://deno.land/manual/getting_started/setup_your_environment&lt;/a&gt;&lt;/p&gt;
&lt;h4 id=&quot;vs-code&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#vs-code&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;VS Code&lt;/h4&gt;
&lt;p&gt;参考リンク: &lt;a href=&quot;https://deno.land/manual/vscode_deno&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://deno.land/manual/vscode_deno&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Deno公式拡張機能の&lt;a href=&quot;https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno&lt;/a&gt;をインストールし、設定から&lt;code&gt;Deno: Enable&lt;/code&gt;（&lt;code&gt;deno.enable&lt;/code&gt;）を有効にする。&lt;code&gt;Deno: Initialize Workspace Configuration&lt;/code&gt;コマンドで&lt;code&gt;.vscode/settings.json&lt;/code&gt;を作成してもよい。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;.vscode/settings.json&lt;/code&gt;の例:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;json5&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;json5&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.json5&quot; href=&quot;data:text/plain;charset=utf-8;base64,ewogICAgImRlbm8uY29uZmlnIjogIi4vZGVuby5qc29uIiwKICAgICJkZW5vLmVuYWJsZSI6IHRydWUsCiAgICAiZGVuby5saW50IjogdHJ1ZSwKICAgICJkZW5vLnVuc3RhYmxlIjogdHJ1ZSwKICAgICJbdHlwZXNjcmlwdF1bdHlwZXNjcmlwdHJlYWN0XVtqYXZhc2NyaXB0XVtqYXZhc2NyaXB0cmVhY3RdW2pzb25dW2pzb25jXVttYXJrZG93bl0iOiB7CiAgICAgICAgImVkaXRvci5kZWZhdWx0Rm9ybWF0dGVyIjogImRlbm9sYW5kLnZzY29kZS1kZW5vIgogICAgfQp9&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-json5&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    &quot;deno.config&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;./deno.json&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    &quot;deno.enable&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    &quot;deno.lint&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    &quot;deno.unstable&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    &quot;[typescript][typescriptreact][javascript][javascriptreact][json][jsonc][markdown]&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;        &quot;editor.defaultFormatter&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;denoland.vscode-deno&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;なお、設定ファイルの名前に&lt;code&gt;deno.jsonc&lt;/code&gt;または&lt;code&gt;deno.json&lt;/code&gt;を使っている場合は自動で認識されるので、&lt;code&gt;deno.config&lt;/code&gt;で設定する必要はない。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;tasks.json&lt;/code&gt;で使えるタスク定義やプロブレムマッチャーも提供されている。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;.vscode/tasks.json&lt;/code&gt;&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;json5&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;json5&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.json5&quot; href=&quot;data:text/plain;charset=utf-8;base64,ewogICAgInZlcnNpb24iOiAiMi4wLjAiLAogICAgInRhc2tzIjogWwogICAgICAgIHsKICAgICAgICAgICAgInR5cGUiOiAiZGVubyIsCiAgICAgICAgICAgICJjb21tYW5kIjogInJ1biIsCiAgICAgICAgICAgICJhcmdzIjogWyJzcmMvbWFpbi50cyJdLAogICAgICAgICAgICAicHJvYmxlbU1hdGNoZXIiOiBbIiRkZW5vIl0KICAgICAgICB9LAogICAgICAgIHsKICAgICAgICAgICAgInR5cGUiOiAiZGVubyIsCiAgICAgICAgICAgICJjb21tYW5kIjogInRlc3QiLAogICAgICAgICAgICAicHJvYmxlbU1hdGNoZXIiOiBbIiRkZW5vLXRlc3QiXQogICAgICAgIH0sCiAgICAgICAgewogICAgICAgICAgICAidHlwZSI6ICJkZW5vIiwKICAgICAgICAgICAgImNvbW1hbmQiOiAibGludCIsCiAgICAgICAgICAgICJwcm9ibGVtTWF0Y2hlciI6IFsiJGRlbm8tbGludCJdCiAgICAgICAgfQogICAgXQp9&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-json5&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    &quot;version&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;2.0.0&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    &quot;tasks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;            &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;deno&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;            &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;run&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;            &quot;args&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;src/main.ts&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;            &quot;problemMatcher&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;$deno&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;            &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;deno&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;            &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;test&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;            &quot;problemMatcher&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;$deno-test&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;            &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;deno&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;            &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;lint&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;            &quot;problemMatcher&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;$deno-lint&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h4 id=&quot;jetbrainsのide&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#jetbrainsのide&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;JetBrainsのIDE&lt;/h4&gt;
&lt;p&gt;JetBrains公式プラグインの&lt;a href=&quot;https://plugins.jetbrains.com/plugin/14382-deno&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://plugins.jetbrains.com/plugin/14382-deno&lt;/a&gt;をインストールする。&lt;/p&gt;
&lt;h2 id=&quot;ファイルの実行&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ファイルの実行&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;ファイルの実行&lt;/h2&gt;
&lt;p&gt;参考リンク: &lt;a href=&quot;https://deno.land/manual/getting_started/command_line_interface&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://deno.land/manual/getting_started/command_line_interface&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Denoでファイルを実行するには&lt;code&gt;deno run&lt;/code&gt;コマンドを用いる。&lt;/p&gt;
&lt;p&gt;&lt;code&gt;hello.ts&lt;/code&gt;:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,Y29uc29sZS5sb2coIkhlbGxvLCBXb3JsZCEiKTs=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;console.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Hello, World!&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;コマンド:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZGVubyBydW4gaGVsbG8udHM=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; hello.ts&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;出力:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;text&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;text&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.text&quot; href=&quot;data:text/plain;charset=utf-8;base64,SGVsbG8sIFdvcmxkIQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Hello, World!&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;リモートのファイルも実行できる。&lt;/p&gt;
&lt;p&gt;コマンド:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,IyDmnIDmlrDniYgKZGVubyBydW4gaHR0cHM6Ly9kZW5vLmxhbmQvc3RkL2V4YW1wbGVzL3dlbGNvbWUudHMKIyAwLjEzMy4wCmRlbm8gcnVuIGh0dHBzOi8vZGVuby5sYW5kL3N0ZEAwLjEzMy4wL2V4YW1wbGVzL3dlbGNvbWUudHM=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 最新版&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://deno.land/std/examples/welcome.ts&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 0.133.0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; https://deno.land/std@0.133.0/examples/welcome.ts&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;出力:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;text&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;text&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.text&quot; href=&quot;data:text/plain;charset=utf-8;base64,V2VsY29tZSB0byBEZW5vIQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Welcome to Deno!&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;ファイル名の後の引数はすべてスクリプトに対する引数となる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZGVubyBydW4gbWFpbi50cyAtLWhlbHA=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; main.ts&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --help&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;パーミッション&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#パーミッション&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;パーミッション&lt;/h2&gt;
&lt;p&gt;参考リンク: &lt;a href=&quot;https://deno.land/manual/getting_started/permissions&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://deno.land/manual/getting_started/permissions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Denoではデフォルトでネットワークやファイルシステムへのアクセスがすべてオフになっている。プログラムからのアクセスを許可するには、実行時にオプションやプロンプトから許可を与える必要がある。&lt;/p&gt;
&lt;p&gt;以下、オプションを列挙するが、実際に&lt;code&gt;deno run&lt;/code&gt;を実行するには実行するファイル名が引数として必要となるとなることには注意。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,IyDjg43jg4Pjg4jjg6/jg7zjgq/jgqLjgq/jgrvjgrkKZGVubyBydW4gLS1hbGxvdy1uZXQKZGVubyBydW4gLS1hbGxvdy1uZXQ9Z2l0aHViLmNvbSxsb2NhbGhvc3Q6ODA4MAojIOODleOCoeOCpOODq+OCt+OCueODhuODoOOCouOCr+OCu+OCue+8iOiqreOBv+WPluOCiu+8iQpkZW5vIHJ1biAtLWFsbG93LXJlYWQKZGVubyBydW4gLS1hbGxvdy1yZWFkPQojIOODleOCoeOCpOODq+OCt+OCueODhuODoOOCouOCr+OCu+OCue+8iOabuOOBjei+vOOBv++8iQpkZW5vIHJ1biAtLWFsbG93LXdyaXRlCmRlbm8gcnVuIC0tYWxsb3ctd3JpdGU9CiMg55Kw5aKD5aSJ5pWwCmRlbm8gcnVuIC0tYWxsb3ctZW52CmRlbm8gcnVuIC0tYWxsb3ctZW52PUhPTUUsUEFUSAoKIyDpq5jliIbop6Pog73mmYLplpPmuKzlrprvvIhoaWdoLXJlc29sdXRpb24gdGltZSBtZWFzdXJlbWVudO+8iQpkZW5vIHJ1biAtLWFsbG93LWhydGltZQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# ネットワークアクセス&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --allow-net&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --allow-net=github.com,localhost:8080&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# ファイルシステムアクセス（読み取り）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --allow-read&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --allow-read=&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# ファイルシステムアクセス（書き込み）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --allow-write&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --allow-write=&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 環境変数&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --allow-env&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --allow-env=HOME,PATH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 高分解能時間測定（high-resolution time measurement）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --allow-hrtime&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;DenoはV8エンジンのサンドボックス機能を使うことでセキュアな実行をサポートしているが、コマンドやFFIはサンドボックス外での実行を許可することになるので、注意が必要となる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,IyDjgrPjg57jg7Pjg4nvvIjjgrXjg5bjg5fjg63jgrvjgrnvvInjga7lrp/ooYwKZGVubyBydW4gLS1hbGxvdy1ydW4KZGVubyBydW4gLS1hbGxvdy1ydW49aW1hZ2VtYWdpY2ssZmZtcGVnCgojIEZGSe+8iOWklumDqOmWouaVsOOCpOODs+OCv+ODvOODleOCp+ODvOOCue+8ieOBq+OCiOOCi+ODgOOCpOODiuODn+ODg+OCr+ODqeOCpOODluODqeODquOBruiqrei+vOODu+Wun+ihjApkZW5vIHJ1biAtLWFsbG93LWZmaQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# コマンド（サブプロセス）の実行&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --allow-run&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --allow-run=imagemagick,ffmpeg&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# FFI（外部関数インターフェース）によるダイナミックライブラリの読込・実行&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --allow-ffi&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;上記のすべてを許可するには&lt;code&gt;--allow-all&lt;/code&gt;または&lt;code&gt;-A&lt;/code&gt;が使えるが、当然注意が必要となる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,IyDjgZnjgbnjgaboqLHlj68KZGVubyBydW4gLS1hbGxvdy1hbGwKZGVubyBydW4gLUE=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# すべて許可&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --allow-all&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -A&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;テスト&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#テスト&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;テスト&lt;/h2&gt;
&lt;p&gt;参考リンク: &lt;a href=&quot;https://deno.land/manual/testing&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://deno.land/manual/testing&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&quot;テストの記述&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#テストの記述&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;テストの記述&lt;/h3&gt;
&lt;p&gt;ファイル名が以下の形式のファイルが、テストファイルとして認識される。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;test.ts&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;*.test.ts&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;*_test.ts&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;hello.test.ts&lt;/code&gt;&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,aW1wb3J0IHsgYXNzZXJ0IH0gZnJvbSAiaHR0cHM6Ly9kZW5vLmxhbmQvc3RkQDAuMTMzLjAvdGVzdGluZy9hc3NlcnRzLnRzIgoKRGVuby50ZXN0KCJIZWxsbywgVGVzdCEiLCAoKSA9PiB7CiAgICBhc3NlcnQoIkhlbGxvLCBUZXN0ISIuaW5jbHVkZXMoIlRlc3QiKSkKfSk=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; { assert } &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;https://deno.land/std@0.133.0/testing/asserts.ts&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;Deno.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Hello, Test!&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, () &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    assert&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Hello, Test!&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;includes&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Test&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;))&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;})&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;Deno.test&lt;/code&gt;のAPIについては:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://doc.deno.land/deno/stable/~/Deno.test&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://doc.deno.land/deno/stable/~/Deno.test&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;std/testing/asserts.ts&lt;/code&gt;モジュールについては:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://doc.deno.land/https://deno.land/std/testing/asserts.ts&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://doc.deno.land/https://deno.land/std/testing/asserts.ts&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;をそれぞれ参照。&lt;/p&gt;
&lt;h3 id=&quot;テストの実行&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#テストの実行&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;テストの実行&lt;/h3&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZGVubyB0ZXN0&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; test&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;でカレントディレクトリ以下の&lt;code&gt;{*_,*.,}test.{ts, tsx, mts, js, mjs, jsx, cjs, cts}&lt;/code&gt;、つまり、&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;text&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;text&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.text&quot; href=&quot;data:text/plain;charset=utf-8;base64,aGVsbG8vdGVzdC50cwpoZWxsby50ZXN0LnRzCmhlbGxvX3Rlc3QudHM=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-text&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;hello/test.ts&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;hello.test.ts&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;hello_test.ts&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;のようなファイルに記述されているテストがすべて実行される。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,IyDjg4fjgqPjg6zjgq/jg4jjg6rjga7mjIflrpoKZGVubyB0ZXN0IGhlbGxvLw==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# ディレクトリの指定&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; test&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; hello/&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,IyDjg5XjgqHjgqTjg6vjga7mjIflrpoKZGVubyB0ZXN0IGhlbGxvLnRlc3QudHM=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# ファイルの指定&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; test&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; hello.test.ts&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;も可能。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,aW1wb3J0IHsgYXNzZXJ0IH0gZnJvbSAiaHR0cHM6Ly9kZW5vLmxhbmQvc3RkQDAuMTMzLjAvdGVzdGluZy9hc3NlcnRzLnRzIgoKRGVuby50ZXN0KCJIZWxsbywgVGVzdCEiLCB7IHBlcm1pc3Npb25zOiB7IHJlYWQ6IHRydWUgfSB9LCAoKSA9PiB7CiAgICBhc3NlcnQodHJ1ZSkKfSk=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; { assert } &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;https://deno.land/std@0.133.0/testing/asserts.ts&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;Deno.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Hello, Test!&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, { permissions: { read: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; } }, () &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    assert&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;})&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;のようにパーミッションが必要な場合は、&lt;code&gt;deno run&lt;/code&gt;の場合と同様にオプションにより実行に許可を与える。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZGVubyB0ZXN0IC0tYWxsb3ctcmVhZA==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; test&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --allow-read&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;リント&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リント&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リント&lt;/h2&gt;
&lt;p&gt;参考リンク: &lt;a href=&quot;https://deno.land/manual/tools/linter&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://deno.land/manual/tools/linter&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;コードのリントは&lt;code&gt;deno lint&lt;/code&gt;コマンドで行う。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,IyDjgZnjgbnjgabjga7jg5XjgqHjgqTjg6vvvIjjgqvjg6zjg7Pjg4jjg4fjgqPjg6zjgq/jg4jjg6rku6XkuIvvvIkKZGVubyBsaW50CiMg5oyH5a6a44GX44Gf44OH44Kj44Os44Kv44OI44OqCmRlbm8gbGludCBzcmMvCiMg5oyH5a6a44GX44Gf44OV44Kh44Kk44OrCmRlbm8gbGludCBzcmMvbWFpbi50c+OAgHNyYy9saWIudHM=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# すべてのファイル（カレントディレクトリ以下）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; lint&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 指定したディレクトリ&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; lint&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; src/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 指定したファイル&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; lint&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; src/main.ts　src/lib.ts&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;ルールの一覧は:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://lint.deno.land/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://lint.deno.land/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;を参照。&lt;/p&gt;
&lt;p&gt;設定ファイルで、含めるファイルやリントのルールを指定できることもできる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;json&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;json&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.json&quot; href=&quot;data:text/plain;charset=utf-8;base64,ewogICAgImxpbnQiOiB7CiAgICAgICAgImZpbGVzIjogewogICAgICAgICAgICAiaW5jbHVkZSI6IFsic3JjLyJdLAogICAgICAgICAgICAiZXhjbHVkZSI6IFsic3JjL3Rlc3RkYXRhLyJdCiAgICAgICAgfSwKICAgICAgICAicnVsZXMiOiB7CiAgICAgICAgICAgICJ0YWdzIjogWyJyZWNvbW1lbmRlZCJdLAogICAgICAgICAgICAiaW5jbHVkZSI6IFsiYmFuLXVudGFnZ2VkLXRvZG8iXSwKICAgICAgICAgICAgImV4Y2x1ZGUiOiBbIm5vLXVudXNlZC12YXJzIl0KICAgICAgICB9CiAgICB9Cn0=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;lint&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;files&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;include&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;src/&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;exclude&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;src/testdata/&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;rules&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;tags&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;recommended&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;include&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;ban-untagged-todo&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;exclude&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;no-unused-vars&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;フォーマット&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#フォーマット&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;フォーマット&lt;/h2&gt;
&lt;p&gt;参考リンク: &lt;a href=&quot;https://deno.land/manual/tools/formatter&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://deno.land/manual/tools/formatter&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;コードのフォーマットは&lt;code&gt;deno fmt&lt;/code&gt;コマンドで行う。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,IyDjgZnjgbnjgabjga7jg5XjgqHjgqTjg6vvvIjjgqvjg6zjg7Pjg4jjg4fjgqPjg6zjgq/jg4jjg6rku6XkuIvvvIkKZGVubyBmbXQKIyDmjIflrprjgZfjgZ/jg4fjgqPjg6zjgq/jg4jjg6oKZGVubyBmbXQgc3JjLwojIOaMh+WumuOBl+OBn+ODleOCoeOCpOODqwpkZW5vIGZtdCBzcmMvbWFpbi50c+OAgHNyYy9saWIudHM=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# すべてのファイル（カレントディレクトリ以下）&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; fmt&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 指定したディレクトリ&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; fmt&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; src/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# 指定したファイル&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; fmt&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; src/main.ts　src/lib.ts&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;設定ファイルで、含めるファイルやフォーマットのオプションを指定することもできる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;json&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;json&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.json&quot; href=&quot;data:text/plain;charset=utf-8;base64,ewogICAgImZtdCI6IHsKICAgICAgICAiZmlsZXMiOiB7CiAgICAgICAgICAgICJpbmNsdWRlIjogWyJzcmMvIl0sCiAgICAgICAgICAgICJleGNsdWRlIjogWyJzcmMvdGVzdGRhdGEvIl0KICAgICAgICB9LAogICAgICAgICJvcHRpb25zIjogewogICAgICAgICAgICAidXNlVGFicyI6IHRydWUsCiAgICAgICAgICAgICJsaW5lV2lkdGgiOiA4MCwKICAgICAgICAgICAgImluZGVudFdpZHRoIjogNCwKICAgICAgICAgICAgInNpbmdsZVF1b3RlIjogdHJ1ZSwKICAgICAgICAgICAgInByb3NlV3JhcCI6ICJwcmVzZXJ2ZSIKICAgICAgICB9CiAgICB9Cn0=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;fmt&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;files&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;include&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;src/&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;exclude&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;src/testdata/&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;options&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;useTabs&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;lineWidth&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;80&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;indentWidth&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;singleQuote&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;proseWrap&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;preserve&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;依存パッケージの管理&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#依存パッケージの管理&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;依存パッケージの管理&lt;/h2&gt;
&lt;h3 id=&quot;depsts&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#depsts&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;code&gt;deps.ts&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;参考リンク: &lt;a href=&quot;https://deno.land/manual/examples/manage_dependencies&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://deno.land/manual/examples/manage_dependencies&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;依存パッケージを何らかのファイルにまとめて管理したい場合は、一つの慣習として次のような名前のファイルにリモートの依存先を記述し、そこから&lt;code&gt;import&lt;/code&gt;して使う。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;deps.ts&lt;/code&gt;（&lt;code&gt;dependencies&lt;/code&gt;）&lt;/li&gt;
&lt;li&gt;&lt;code&gt;dev_deps.ts&lt;/code&gt;（&lt;code&gt;devDependencies&lt;/code&gt;）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;src/deps.ts&lt;/code&gt;:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZXhwb3J0ICogYXMgeWFtbCBmcm9tICJodHRwczovL2Rlbm8ubGFuZC9zdGRAMC4xMzMuMC9lbmNvZGluZy95YW1sLnRzIg==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; as&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; yaml &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;https://deno.land/std@0.133.0/encoding/yaml.ts&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;src/main.ts&lt;/code&gt;:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,aW1wb3J0IHsgeWFtbCB9IGZyb20gIi4vZGVwcy50cyIKCmNvbnN0IGFydGljbGUgPSB5YW1sLnBhcnNlKGAKdGl0bGU6IEhlbGxvLCBEZW5vIQpkZXNjcmlwdGlvbjogQW4gaW50cm9kdWN0aW9uIHRvIERlbm8uCmApCgpjb25zb2xlLmxvZyhhcnRpY2xlKQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; { yaml } &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;./deps.ts&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; article&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; yaml.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;parse&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;`&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;title: Hello, Deno!&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;description: An introduction to Deno.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;`&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;console.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;log&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(article)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h3 id=&quot;lockjson&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#lockjson&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;&lt;code&gt;lock.json&lt;/code&gt;&lt;/h3&gt;
&lt;p&gt;参考リンク: &lt;a href=&quot;https://deno.land/manual/linking_to_external_code/integrity_checking.md&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://deno.land/manual/linking_to_external_code/integrity_checking.md&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;複数の環境で本当に同一のパッケージが使われているか整合性を確かめるには、ロックファイルを使う。&lt;/p&gt;
&lt;p&gt;ファイル名は公式マニュアルの例では&lt;code&gt;lock.json&lt;/code&gt;となっているが、個人的には&lt;code&gt;deno.lock.json&lt;/code&gt;を使いたい。&lt;/p&gt;
&lt;p&gt;ロックファイルを生成するには:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZGVubyBjYWNoZSAtLWxvY2std3JpdGUgLS1sb2NrPWRlbm8ubG9jay5qc29uIHNyYy9kZXBzLnRz&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; cache&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --lock-write&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --lock=deno.lock.json&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; src/deps.ts&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;ロックファイルを使ってキャッシュを再読み込みするには:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZGVubyBjYWNoZSAtLXJlbG9hZCAtLWxvY2s9ZGVuby5sb2NrLmpzb24gc3JjL2RlcHMudHM=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;deno&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; cache&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --reload&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --lock=deno.lock.json&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; src/deps.ts&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;感想&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#感想&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;感想&lt;/h2&gt;
&lt;p&gt;Node.jsへの反省として発表されてからしばらく経っているが、当初思ったよりは普及しておらず、開発中の機能も多い。&lt;/p&gt;
&lt;p&gt;特に、外部ライブラリを使う起点となるパッケージ管理の仕組みについては、Goが結局&lt;code&gt;go.mod&lt;/code&gt;や&lt;code&gt;go.sum&lt;/code&gt;を導入したように、ファイルでまとめて管理するように戻してしまったほうがいいのではという感がいなめなず、結果として、外部ライブラリを使うときにこそ良さを発揮するであろうサンドックス機能の恩恵にも与りにくくなっている。&lt;/p&gt;
&lt;p&gt;とはいえ、TypeScriptと&lt;code&gt;await&lt;/code&gt;がそのまま使えるのと、テストランナーやフォーマッター、リンターがデフォルトでついてくるのは、プロジェクトをミニマルに保ちたい場合にはうれしい利点となっている。&lt;/p&gt;
&lt;p&gt;当面はTypeScriptのみで外部ライブラリさえ使わない小さな個人プロジェクトで使いつつ、今後の行く末に期待したい。
$&lt;/p&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/deno</id>
<title type="text">Deno</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/deno" />
<published>2022-04-02T20:53:03.766Z</published>
<updated>2022-04-02T20:53:03.766Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式サイト: &lt;a href=&quot;https://deno.land/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://deno.land/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;公式マニュアル: &lt;a href=&quot;https://deno.land/manual&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://deno.land/manual&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;リポジトリ: &lt;a href=&quot;https://github.com/denoland/deno&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/denoland/deno&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;ランタイムAPI: &lt;a href=&quot;https://doc.deno.land/deno/stable&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://doc.deno.land/deno/stable&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;標準ライブラリ: &lt;a href=&quot;https://deno.land/std&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://deno.land/std&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-03-21-next-static-export</id>
<title type="text">Next.jsで静的サイトとしてエクスポートする</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-03-21-next-static-export" />
<published>2022-03-21T17:02:27.182Z</published>
<updated>2022-03-21T17:02:27.182Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Next.js" />
<content type="html">&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bmV4dCBidWlsZCAmJiBuZXh0IGV4cG9ydA==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;next&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; build&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; &amp;#x26;&amp;#x26; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;next&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; export&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;スクリプトを、&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;json&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;json&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.json&quot; href=&quot;data:text/plain;charset=utf-8;base64,ewogICJzY3JpcHRzIjogewogICAgImJ1aWxkIjogIm5leHQgYnVpbGQgJiYgbmV4dCBleHBvcnQiCiAgfQp9&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;scripts&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;build&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;next build &amp;#x26;&amp;#x26; next export&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;のようにしておくと便利。&lt;/p&gt;
&lt;h2 id=&quot;参考&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#参考&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;参考&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://nextjs.org/docs/advanced-features/static-html-export&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://nextjs.org/docs/advanced-features/static-html-export&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/vercel/next.js/tree/canary/examples/with-static-export&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/vercel/next.js/tree/canary/examples/with-static-export&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-03-21-next-sass</id>
<title type="text">Next.jsでSass/SCSSを有効にする</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-03-21-next-sass" />
<published>2022-03-21T16:51:53.757Z</published>
<updated>2022-03-21T16:51:53.757Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Next.js" /><category term="Sass/SCSS" />
<content type="html">&lt;p&gt;Sassの追加:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bnBtIGkgLUQgc2Fzcw==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; i&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -D&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; sass&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;TypeScriptを作っている場合、&lt;code&gt;custom.d.ts&lt;/code&gt;のようなファイルを作り:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZGVjbGFyZSBtb2R1bGUgIioubW9kdWxlLmNzcyIKZGVjbGFyZSBtb2R1bGUgIioubW9kdWxlLnNhc3MiCmRlY2xhcmUgbW9kdWxlICIqLm1vZHVsZS5zY3NzIg==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;declare&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; module&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;*.module.css&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;declare&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; module&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;*.module.sass&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;declare&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; module&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;*.module.scss&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;参考&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#参考&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;参考&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://nextjs.org/docs/basic-features/built-in-css-support#sass-support&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://nextjs.org/docs/basic-features/built-in-css-support#sass-support&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/sass</id>
<title type="text">Sass/SCSS</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/sass" />
<published>2022-03-21T16:46:33.543Z</published>
<updated>2022-03-21T16:46:33.543Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式サイト: &lt;a href=&quot;https://sass-lang.com&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://sass-lang.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;リポジトリ: &lt;a href=&quot;https://github.com/sass/dart-sass&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/sass/dart-sass&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/prettier</id>
<title type="text">Prettier</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/prettier" />
<published>2022-03-21T16:34:03.186Z</published>
<updated>2022-03-21T16:34:03.186Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;ul&gt;
&lt;li&gt;公式サイト: &lt;a href=&quot;https://prettier.io&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://prettier.io&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;リポジトリ: &lt;a href=&quot;https://github.com/prettier/prettier&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/prettier/prettier&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-03-21-next-prettier</id>
<title type="text">Next.jsのプロジェクトに`prettier`を追加する</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-03-21-next-prettier" />
<published>2022-03-21T16:32:22.689Z</published>
<updated>2022-03-21T16:32:22.689Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Next.js" /><category term="Prettier" />
<content type="html">&lt;p&gt;依存パッケージの追加:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bnBtIGkgLUQgcHJldHRpZXIgZXNsaW50LWNvbmZpZy1wcmV0dGllcg==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; i&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -D&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; prettier&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; eslint-config-prettier&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;.eslintrc.json&lt;/code&gt;への追記:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;json&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;json&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.json&quot; href=&quot;data:text/plain;charset=utf-8;base64,ewogICJleHRlbmRzIjogWyJuZXh0L2NvcmUtd2ViLXZpdGFscyIsICJwcmV0dGllciJdCn0=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;extends&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;next/core-web-vitals&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;prettier&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;.prettierignore&lt;/code&gt;への追記:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;&quot;&gt;&lt;figcaption&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.txt&quot; href=&quot;data:text/plain;charset=utf-8;base64,Ly5uZXh0Lwovb3V0Lwo=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre&gt;&lt;code&gt;/.next/
/out/
&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;npmスクリプトの追加（任意）:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;json&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;json&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.json&quot; href=&quot;data:text/plain;charset=utf-8;base64,ewogICJzY3JpcHRzIjogewogICAgImZvcm1hdCI6ICJwcmV0dGllciAtLXdyaXRlIC4iCiAgfSwKfQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-json&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;scripts&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;format&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;prettier --write .&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-03-21-go-create-app</id>
<title type="text">Goアプリケーションの作成</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-03-21-go-create-app" />
<published>2022-03-21T15:52:39.293Z</published>
<updated>2022-03-21T15:52:39.293Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;プロジェクトの作成&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#プロジェクトの作成&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;プロジェクトの作成&lt;/h2&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,Z28gbW9kIGluaXQgZXhhbXBsZS9oZWxsbw==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;go&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; mod&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; init&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; example/hello&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;次のような&lt;code&gt;go.mod&lt;/code&gt;が生成される:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;go-mod&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;go-mod&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.go-mod&quot; href=&quot;data:text/plain;charset=utf-8;base64,bW9kdWxlIGV4YW1wbGUvaGVsbG8KCmdvIDEuMTgK&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre&gt;&lt;code class=&quot;language-go-mod&quot;&gt;module example/hello

go 1.18
&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;main.go&lt;/code&gt;を作成する（ファイル名は任意）:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;go&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;go&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.go&quot; href=&quot;data:text/plain;charset=utf-8;base64,cGFja2FnZSBtYWluCgppbXBvcnQgImZtdCIKCmZ1bmMgbWFpbigpIHsKICAgIGZtdC5QcmludGxuKCJIZWxsbywgV29ybGQhIikKfQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-go&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;package&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; main&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;fmt&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;func&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; main&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    fmt.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;Println&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Hello, World!&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;実行は:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,Z28gcnVuIC4=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;go&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; .&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;パッケージの追加&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#パッケージの追加&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;パッケージの追加&lt;/h2&gt;
&lt;p&gt;例えば:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,Z28gZ2V0IGdpdGh1Yi5jb20vbGFic3RhY2svZWNoby92NA==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;go&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; get&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; github.com/labstack/echo/v4&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;main.go&lt;/code&gt;を次のように書き直して:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;go&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;go&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.go&quot; href=&quot;data:text/plain;charset=utf-8;base64,cGFja2FnZSBtYWluCgppbXBvcnQgKAoJIm5ldC9odHRwIgoKCSJnaXRodWIuY29tL2xhYnN0YWNrL2VjaG8vdjQiCikKCmZ1bmMgbWFpbigpIHsKCS8vIEVjaG8gaW5zdGFuY2UKCWUgOj0gZWNoby5OZXcoKQoKCS8vIFJvdXRlcwoJZS5HRVQoIi8iLCBoZWxsbykKCgkvLyBTdGFydCBzZXJ2ZXIKCWUuTG9nZ2VyLkZhdGFsKGUuU3RhcnQoIjoxMzIzIikpCn0KCi8vIEhhbmRsZXIKZnVuYyBoZWxsbyhjIGVjaG8uQ29udGV4dCkgZXJyb3IgewoJcmV0dXJuIGMuU3RyaW5nKGh0dHAuU3RhdHVzT0ssICJIZWxsbywgV29ybGQhIikKfQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-go&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;package&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; main&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; (&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;	&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;net/http&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;	&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;github.com/labstack/echo/v4&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;func&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; main&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;	// Echo instance&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;	e &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; echo.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;New&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;	// Routes&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;	e.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;GET&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;/&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, hello)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;	// Start server&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;	e.Logger.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;Fatal&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(e.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;Start&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;:1323&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;))&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;// Handler&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;func&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; hello&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;Context&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;	return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; c.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(http.StatusOK, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Hello, World!&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;実行すると:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,Z28gcnVuIC4=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;go&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; .&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;a href=&quot;http://localhost:1323/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;http://localhost:1323/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;で&lt;code&gt;&quot;Hello, World!&lt;/code&gt;が表示されるようになる。&lt;/p&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-03-17-create-next-app</id>
<title type="text">`create-next-app`を使って現在のディレクトリにTypeScriptのNext.jsプロジェクトの雛形を生成する</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-03-17-create-next-app" />
<published>2022-03-17T21:11:11.180Z</published>
<updated>2022-03-17T21:11:11.180Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Next.js" /><category term="TypeScript" />
<content type="html">&lt;p&gt;npm:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bnB4IGNyZWF0ZS1uZXh0LWFwcEBsYXRlc3QgLS10cyAu&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; create-next-app@latest&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --ts&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; .&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;yarn:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,eWFybiBjcmVhdGUgbmV4dC1hcHAgLS10cyAu&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;yarn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; create&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; next-app&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --ts&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; .&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;pnpm:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,cG5wbSBjcmVhdGUgbmV4dC1hcHAgLS10cyAu&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;pnpm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; create&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; next-app&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --ts&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; .&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-03-11-nextjs-config-typing</id>
<title type="text">Next.jsの設定ファイルの型定義</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-03-11-nextjs-config-typing" />
<published>2022-03-11T09:53:49.488Z</published>
<updated>2022-03-11T09:53:49.488Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Next.js" />
<content type="html">&lt;p&gt;&lt;code&gt;next.config.mjs&lt;/code&gt;:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;js&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;js&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.js&quot; href=&quot;data:text/plain;charset=utf-8;base64,Ly8gQHRzLWNoZWNrCiJ1c2Ugc3RyaWN0IgoKLyoqCiAqCiAqIEBwYXJhbSB7IHN0cmluZyB9IHBoYXNlCiAqIEBwYXJhbSB7eyBkZWZhdWx0Q29uZmlnOiBpbXBvcnQoIm5leHQiKS5OZXh0Q29uZmlnIH19IGNvbmZpZwogKiBAcmV0dXJucyB7IFByb21pc2U8aW1wb3J0KCJuZXh0IikuTmV4dENvbmZpZz4gfQogKi8KZXhwb3J0IGRlZmF1bHQgYXN5bmMgZnVuY3Rpb24gY3JlYXRlTmV4dENvbmZpZyhwaGFzZSwgeyBkZWZhdWx0Q29uZmlnIH0pIHsKICAgIHJldHVybiB7CiAgICAgICAgcmVhY3RTdHJpY3RNb2RlOiB0cnVlLAogICAgfQp9&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;// @ts-check&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;use strict&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;/**&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt; *&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt; * &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;@param&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; { string }&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; phase&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt; * &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;@param&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; {{ defaultConfig: import(&quot;next&quot;).NextConfig }}&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; config&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt; * &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;@returns&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; { Promise&amp;#x3C;import(&quot;next&quot;).NextConfig&gt; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt; */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; default&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; async&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; function&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; createNextConfig&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;phase&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, { &lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;defaultConfig&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; }) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        reactStrictMode: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;参考&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#参考&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;参考&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/vercel/next.js/blob/e57d621fb38562b1d5ae02fb6f7efd343e1db405/packages/next/server/config-shared.ts#L475-L481&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/vercel/next.js/blob/e57d621fb38562b1d5ae02fb6f7efd343e1db405/packages/next/server/config-shared.ts#L475-L481&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/nextjs</id>
<title type="text">Next.js</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/nextjs" />
<published>2022-03-11T09:53:49.488Z</published>
<updated>2022-03-11T09:53:49.488Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式サイト: &lt;a href=&quot;https://nextjs.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://nextjs.org/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;リポジトリ: &lt;a href=&quot;https://github.com/vercel/next.js&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/vercel/next.js&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-03-10-font-weight-name</id>
<title type="text">フォントのウェイト名と数値の対応表</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-03-10-font-weight-name" />
<published>2022-03-10T20:52:36.745Z</published>
<updated>2022-03-10T20:52:36.745Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="フォント" /><category term="CSS" />
<content type="html">&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;数値&lt;/th&gt;
&lt;th&gt;名前&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;td&gt;Thin&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;200&lt;/td&gt;
&lt;td&gt;Extra Light (Ultra Light)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;300&lt;/td&gt;
&lt;td&gt;Light&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;Normal&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;500&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;600&lt;/td&gt;
&lt;td&gt;Semi Bold (Demi Bold)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;700&lt;/td&gt;
&lt;td&gt;Bold&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;800&lt;/td&gt;
&lt;td&gt;Extra Bold (Ultra Bold)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;900&lt;/td&gt;
&lt;td&gt;Black (Heavy)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;css&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;css&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.css&quot; href=&quot;data:text/plain;charset=utf-8;base64,LmZvbnQtd2VpZ2h0IHsKICAgIGZvbnQtd2VpZ2h0OiAxMDA7IC8qIHRoaW4gKi8KICAgIGZvbnQtd2VpZ2h0OiAyMDA7IC8qIGV4dHJhIGxpZ2h0ICovCiAgICBmb250LXdlaWdodDogMzAwOyAvKiBsaWdodCAqLwogICAgZm9udC13ZWlnaHQ6IDQwMDsgLyogbm9ybWFsICovCiAgICBmb250LXdlaWdodDogNTAwOyAvKiBtZWRpdW0gKi8KICAgIGZvbnQtd2VpZ2h0OiA2MDA7IC8qIHNlbWkgYm9sZCAqLwogICAgZm9udC13ZWlnaHQ6IDcwMDsgLyogYm9sZCAqLwogICAgZm9udC13ZWlnaHQ6IDgwMDsgLyogZXh0cmEgYm9sZCAqLwogICAgZm9udC13ZWlnaHQ6IDkwMDsgLyogYmxhY2sgKi8KfQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;.font-weight&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    font-weight&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;100&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;/* thin */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    font-weight&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;200&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;/* extra light */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    font-weight&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;300&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;/* light */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    font-weight&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;400&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;/* normal */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    font-weight&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;500&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;/* medium */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    font-weight&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;600&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;/* semi bold */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    font-weight&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;700&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;/* bold */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    font-weight&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;800&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;/* extra bold */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    font-weight&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;900&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;/* black */&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;参考&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#参考&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;参考&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.w3.org/TR/css-fonts-3/#font-weight-numeric-values&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.w3.org/TR/css-fonts-3/#font-weight-numeric-values&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.microsoft.com/typography/opentype/spec/os2#usweightclass&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://docs.microsoft.com/typography/opentype/spec/os2#usweightclass&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/css</id>
<title type="text">CSS</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/css" />
<published>2022-03-10T20:52:36.745Z</published>
<updated>2022-03-10T20:52:36.745Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;仕様: &lt;a href=&quot;https://www.w3.org/TR/css/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.w3.org/TR/css/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;WG: &lt;a href=&quot;https://www.w3.org/Style/CSS/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.w3.org/Style/CSS/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;MDN: &lt;a href=&quot;https://developer.mozilla.org/docs/Web/CSS&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developer.mozilla.org/docs/Web/CSS&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/font</id>
<title type="text">フォント</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/font" />
<published>2022-03-10T20:52:36.745Z</published>
<updated>2022-03-10T20:52:36.745Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;h3 id=&quot;仕様&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#仕様&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;仕様&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;True Type Font（&lt;code&gt;ttf&lt;/code&gt;、&lt;a href=&quot;https://developer.apple.com/fonts/TrueType-Reference-Manual/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;仕様&lt;/a&gt;）&lt;/li&gt;
&lt;li&gt;Open Type Font（&lt;code&gt;otf&lt;/code&gt;、&lt;a href=&quot;https://docs.microsoft.com/typography/opentype/spec/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;仕様&lt;/a&gt;）&lt;/li&gt;
&lt;li&gt;Web Open Font Format（&lt;code&gt;woff&lt;/code&gt;、&lt;a href=&quot;https://www.w3.org/TR/WOFF/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;仕様&lt;/a&gt;）&lt;/li&gt;
&lt;li&gt;Web Open Font Format 2.0（&lt;code&gt;woff2&lt;/code&gt;、&lt;a href=&quot;https://www.w3.org/TR/WOFF2/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;仕様&lt;/a&gt;）&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;資料&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#資料&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;資料&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Microsoft Typography
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.microsoft.com/typography/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://docs.microsoft.com/typography/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Adobe
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://helpx.adobe.com/fonts/using/adobe-type-resources-faq.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://helpx.adobe.com/fonts/using/adobe-type-resources-faq.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/adobe-type-tools/font-tech-notes&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/adobe-type-tools/font-tech-notes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;FontForge Technical References
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://fontforge.org/docs/techref.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://fontforge.org/docs/techref.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://fontforge.org/docs/appendices/bibliography.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://fontforge.org/docs/appendices/bibliography.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Google
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://fonts.google.com/knowledge&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://fonts.google.com/knowledge&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://googlefonts.github.io&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://googlefonts.github.io&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;SIL International
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://scripts.sil.org/cms/scripts/page.php?item_id=IWS-Chapter07&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://scripts.sil.org/cms/scripts/page.php?item_id=IWS-Chapter07&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://scripts.sil.org/cms/scripts/page.php?item_id=IWS-Chapter08&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://scripts.sil.org/cms/scripts/page.php?item_id=IWS-Chapter08&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://scripts.sil.org/IWS-AppendixC&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://scripts.sil.org/IWS-AppendixC&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;css&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#css&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;CSS&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;CSS Fonts: &lt;a href=&quot;https://www.w3.org/TR/css-fonts/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.w3.org/TR/css-fonts/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;CSS Fonts (Draft): &lt;a href=&quot;https://drafts.csswg.org/css-fonts/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://drafts.csswg.org/css-fonts/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;MDN &lt;code&gt;@font-face&lt;/code&gt;: &lt;a href=&quot;https://developer.mozilla.org/docs/Web/CSS/@font-face&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developer.mozilla.org/docs/Web/CSS/@font-face&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;web.dev - Fonts: &lt;a href=&quot;https://web.dev/tags/fonts/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://web.dev/tags/fonts/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;ブログ&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ブログ&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;ブログ&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://fonts.googleblog.com&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://fonts.googleblog.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://blog.typekit.com&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://blog.typekit.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://ccjktype.fonts.adobe.com&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://ccjktype.fonts.adobe.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;実装&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#実装&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;実装&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;.NET (WPF)
&lt;ul&gt;
&lt;li&gt;Language: C#&lt;/li&gt;
&lt;li&gt;Source: &lt;a href=&quot;https://github.com/dotnet/wpf&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/dotnet/wpf&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/dotnet/wpf/tree/master/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/internal&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;MS.Internal&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/dotnet/wpf/tree/master/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;System.Windows.Media&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href=&quot;https://docs.microsoft.com/dotnet/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://docs.microsoft.com/dotnet/&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.microsoft.com/dotnet/api/system.windows.media&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;System.Windows.Media&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Note: Developed by Microsoft. Used by Windows.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Core Text
&lt;ul&gt;
&lt;li&gt;Language: C with Objective-C/Swift API&lt;/li&gt;
&lt;li&gt;Source: Closed.&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href=&quot;https://developer.apple.com/documentation/coretext&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developer.apple.com/documentation/coretext&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Note: Developed by Apple. Used by iOS, macOS, tvOS, and watchOS.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Adobe Font Development Kit for OpenType (AFDKO)
&lt;ul&gt;
&lt;li&gt;Language: C&lt;/li&gt;
&lt;li&gt;Source: &lt;a href=&quot;https://github.com/adobe-type-tools/afdko&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/adobe-type-tools/afdko&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href=&quot;https://adobe-type-tools.github.io/afdko/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://adobe-type-tools.github.io/afdko/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Note: Developed by Adobe.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;FreeType
&lt;ul&gt;
&lt;li&gt;Language: C&lt;/li&gt;
&lt;li&gt;Source: &lt;a href=&quot;https://gitlab.freedesktop.org/freetype/freetype/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://gitlab.freedesktop.org/freetype/freetype/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href=&quot;https://www.freetype.org/freetype2/docs/documentation.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.freetype.org/freetype2/docs/documentation.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Note: Used by iOS, Android, Chromium, GNU/Linus, and more.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;HarfBuzz
&lt;ul&gt;
&lt;li&gt;Language: C++&lt;/li&gt;
&lt;li&gt;Source: &lt;a href=&quot;https://github.com/harfbuzz/harfbuzz&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/harfbuzz/harfbuzz&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href=&quot;https://harfbuzz.github.io&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://harfbuzz.github.io&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Note: Used with FreeType by Android, Chromium, Firefox, and more.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;fontTools
&lt;ul&gt;
&lt;li&gt;Language: Python&lt;/li&gt;
&lt;li&gt;Source: &lt;a href=&quot;https://github.com/fonttools/fonttools&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/fonttools/fonttools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href=&quot;https://fonttools.readthedocs.io&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://fonttools.readthedocs.io&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Note: Used by Google and Adobe.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;OpenType Sanitizer
&lt;ul&gt;
&lt;li&gt;Language: C++&lt;/li&gt;
&lt;li&gt;Source: &lt;a href=&quot;https://github.com/khaledhosny/ots&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/khaledhosny/ots&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href=&quot;https://github.com/khaledhosny/ots/tree/main/docs&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/khaledhosny/ots/tree/main/docs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Note: Used by Chromium and Firefox to validate font files.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;golang.org/x/image/font&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;Language: Go&lt;/li&gt;
&lt;li&gt;Source: &lt;a href=&quot;https://github.com/golang/image&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/golang/image&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href=&quot;https://pkg.go.dev/golang.org/x/image/font&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://pkg.go.dev/golang.org/x/image/font&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Note: Go&#39;s library.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-03-10-webpack-html-react</id>
<title type="text">`html-webpack-plugin`でReactをテンプレートに使う</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-03-10-webpack-html-react" />
<published>2022-03-10T12:56:45.979Z</published>
<updated>2022-03-10T12:56:45.979Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="webpack" /><category term="React" /><category term="TypeScript" />
<content type="html">&lt;p&gt;テンプレートに指定したファイルから&lt;code&gt;module.exports&lt;/code&gt;で&lt;code&gt;string&lt;/code&gt;またはそれを返す関数、&lt;code&gt;Promise&lt;/code&gt;を出力すればいいので、&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;js&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;js&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.js&quot; href=&quot;data:text/plain;charset=utf-8;base64,Y29uc3QgSHRtbFdlYnBhY2tQbHVnaW4gPSByZXF1aXJlKCJodG1sLXdlYnBhY2stcGx1Z2luIikKCm1vZHVsZS5leHBvcnRzID0gewogICAgLy8gLi4uCiAgICBwbHVnaW5zOiBbCiAgICAgICAgLy8gLi4uCiAgICAgICAgbmV3IEh0bWxXZWJwYWNrUGx1Z2luKHsKICAgICAgICAgICAgZmlsZW5hbWU6ICJpbmRleC5odG1sIiwKICAgICAgICAgICAgdGVtcGxhdGU6ICJzcmMvaW5kZXguaHRtbC50c3giLAogICAgICAgIH0pLAogICAgXSwKfTs=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; HtmlWebpackPlugin&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; require&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;html-webpack-plugin&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;module&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;exports&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;    // ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    plugins: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;        // ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;        new&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; HtmlWebpackPlugin&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;            filename: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;index.html&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;            template: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;src/index.html.tsx&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        }),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    ],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;};&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;のように設定し、&lt;code&gt;index.html.tsx&lt;/code&gt;で、&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;tsx&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;tsx&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.tsx&quot; href=&quot;data:text/plain;charset=utf-8;base64,aW1wb3J0IFJlYWN0IGZyb20gInJlYWN0IgppbXBvcnQgeyByZW5kZXJUb1N0YXRpY01hcmt1cCB9IGZyb20gInJlYWN0LWRvbS9zZXJ2ZXIiCgpleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiAoKSB7CiAgICByZXR1cm4gKAogICAgICAgIGA8IURPQ1RZUEUgaHRtbD5gICsKICAgICAgICByZW5kZXJUb1N0YXRpY01hcmt1cCgKICAgICAgICAgICAgPGh0bWwgbGFuZz0iZW4iPgogICAgICAgICAgICAgICAgPGhlYWQ+CiAgICAgICAgICAgICAgICAgICAgPG1ldGEgY2hhclNldD0idXRmLTgiIC8+CiAgICAgICAgICAgICAgICAgICAgPG1ldGEKICAgICAgICAgICAgICAgICAgICAgICAgbmFtZT0idmlld3BvcnQiCiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnQ9IndpZHRoPWRldmljZS13aWR0aCxpbml0aWFsLXNjYWxlPTEuMCIKICAgICAgICAgICAgICAgICAgICAvPgogICAgICAgICAgICAgICAgICAgIDx0aXRsZT5UaXRsZTwvdGl0bGU+CiAgICAgICAgICAgICAgICA8L2hlYWQ+CiAgICAgICAgICAgICAgICA8Ym9keT4KICAgICAgICAgICAgICAgICAgICA8cD5IZWxsbywgaHRtbC13ZWJwYWNrLXBsdWdpbi48L3A+CiAgICAgICAgICAgICAgICA8L2JvZHk+CiAgICAgICAgICAgIDwvaHRtbD4KICAgICAgICApCiAgICApCn0=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-tsx&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; React &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;react&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; { renderToStaticMarkup } &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;react-dom/server&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; default&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; function&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; () {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; (&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;        `&amp;#x3C;!DOCTYPE html&gt;`&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; +&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;        renderToStaticMarkup&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;            &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; lang&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;en&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;head&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;meta&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; charSet&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;meta&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;                        name&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;viewport&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;                        content&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;width=device-width,initial-scale=1.0&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                    /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;title&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;Title&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;title&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                &amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;head&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;Hello, html-webpack-plugin.&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;                &amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;            &amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        )&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    )&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;のように、&lt;a href=&quot;https://reactjs.org/docs/react-dom-server.html#rendertostaticmarkup&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;renderToStaticMarkup&lt;/code&gt;&lt;/a&gt;を使って文字列を返す関数を&lt;code&gt;export&lt;/code&gt;すればよい。&lt;/p&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/react</id>
<title type="text">React</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/react" />
<published>2022-03-10T12:56:45.979Z</published>
<updated>2022-03-10T12:56:45.979Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式サイト: &lt;a href=&quot;https://reactjs.org&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://reactjs.org&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;リポジトリ: &lt;a href=&quot;https://github.com/facebook/react/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/facebook/react/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/typescript</id>
<title type="text">TypeScript</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/typescript" />
<published>2022-03-06T21:08:08.625Z</published>
<updated>2022-03-06T21:08:08.625Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式サイト: &lt;a href=&quot;https://www.typescriptlang.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.typescriptlang.org/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;リポジトリ: &lt;a href=&quot;https://github.com/microsoft/TypeScript&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/microsoft/TypeScript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;FAQs: &lt;a href=&quot;https://github.com/microsoft/TypeScript/wiki/FAQ&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/microsoft/TypeScript/wiki/FAQ&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;古い仕様: &lt;a href=&quot;https://github.com/microsoft/TypeScript/blob/main/doc/spec-ARCHIVED.md&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/microsoft/TypeScript/blob/main/doc/spec-ARCHIVED.md&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;コンパイラ資料: &lt;a href=&quot;https://github.com/microsoft/TypeScript-Compiler-Notes/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/microsoft/TypeScript-Compiler-Notes/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-03-06-typescript-nominal</id>
<title type="text">TypeScriptでNominalな型付けを実現する</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-03-06-typescript-nominal" />
<published>2022-03-06T21:06:25.109Z</published>
<updated>2022-03-06T21:06:25.109Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="TypeScript" />
<content type="html">&lt;p&gt;TypeScript公式リポジトリの&lt;a href=&quot;https://github.com/microsoft/TypeScript/wiki/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Wiki&lt;/a&gt;内にあるFAQ「&lt;a href=&quot;https://github.com/microsoft/TypeScript/wiki/FAQ#can-i-make-a-type-alias-nominal&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Can I make a type alias nominal?&lt;/a&gt;」でワークアラウンドとして紹介されているように、交差型（&lt;code&gt;&amp;#x26;&lt;/code&gt;）を利用する。&lt;/p&gt;
&lt;p&gt;たとえば次のような型を用意しておけば:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,dHlwZSBOb21pbmFsPFQgZXh0ZW5kcyBzdHJpbmc+ID0gewogICAgX19ub21pbmFsX186IFQKfQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Nominal&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;T&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; extends&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;    __nominal__&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; T&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;次のように型でのみ区別可能な文字列型を作ることができる:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,dHlwZSBQbGFjZUlkID0gc3RyaW5nICYgTm9taW5hbDwiUGxhY2VJZCI+CnR5cGUgRXZlbnRJZCA9IHN0cmluZyAmIE5vbWluYWw8IkV2ZW50SWQiPg==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; PlaceId&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &amp;#x26;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Nominal&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;PlaceId&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; EventId&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &amp;#x26;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Nominal&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;EventId&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;ただし次のように型アサーションが必要となる:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,Y29uc3QgcGxhY2VJZCA9ICJwbGFjZTEiIGFzIFBsYWNlSWQKY29uc3QgZXZlbnRJZCA9ICJldmVudDEiIGFzIEV2ZW50SWQ=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; placeId&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;place1&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; as&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; PlaceId&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; eventId&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;event1&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; as&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; EventId&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-03-05-html-escape-js</id>
<title type="text">HTMLの特殊文字をJavaScriptでエスケープする</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-03-05-html-escape-js" />
<published>2022-03-05T17:37:12.065Z</published>
<updated>2022-03-05T17:37:12.065Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="HTML" /><category term="JavaScript" />
<content type="html">&lt;figure data-code-block=&quot;&quot; data-language=&quot;ts&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;ts&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.ts&quot; href=&quot;data:text/plain;charset=utf-8;base64,ZnVuY3Rpb24gZXNjYXBlKGh0bWw6IHN0cmluZykgewogICAgcmV0dXJuIGh0bWwucmVwbGFjZUFsbCgvWzw+JiciXS9nLCBjID0+IHsKICAgICAgICBzd2l0Y2ggKGMpIHsKICAgICAgICAgICAgY2FzZSAiPCI6CiAgICAgICAgICAgICAgICByZXR1cm4gIiZsdDsiCiAgICAgICAgICAgIGNhc2UgIj4iOgogICAgICAgICAgICAgICAgcmV0dXJuICImZ3Q7IgogICAgICAgICAgICBjYXNlICImIjoKICAgICAgICAgICAgICAgIHJldHVybiAiJmFtcDsiCiAgICAgICAgICAgIGNhc2UgIiciOgogICAgICAgICAgICAgICAgcmV0dXJuICImYXBvczsiCiAgICAgICAgICAgIGNhc2UgJyInOgogICAgICAgICAgICAgICAgcmV0dXJuICImcXVvdDsiCiAgICAgICAgICAgIGRlZmF1bHQ6CiAgICAgICAgICAgICAgICByZXR1cm4gYwogICAgICAgIH0KICAgIH0pCn0=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-ts&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; escape&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; html.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;replaceAll&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;[&amp;#x3C;&gt;&amp;#x26;&#39;&quot;]&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;g&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;c&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;        switch&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; (c) {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;            case&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&amp;#x3C;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;                return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&amp;#x26;lt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;            case&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;                return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&amp;#x26;gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;            case&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&amp;#x26;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;                return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&amp;#x26;amp;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;            case&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&#39;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;                return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&amp;#x26;apos;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;            case&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &#39;&quot;&#39;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;                return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&amp;#x26;quot;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;            default&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;                return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; c&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    })&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/html</id>
<title type="text">HTML</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/html" />
<published>2022-03-05T17:37:12.065Z</published>
<updated>2022-02-13T15:29:19.534Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;HTML Standard: &lt;a href=&quot;https://html.spec.whatwg.org/multipage/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://html.spec.whatwg.org/multipage/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;MDN: &lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTML&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developer.mozilla.org/docs/Web/HTML&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/javascript</id>
<title type="text">JavaScript</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/javascript" />
<published>2022-03-05T17:37:12.065Z</published>
<updated>2022-02-13T15:28:32.728Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;ECMAScript Language Specification: &lt;a href=&quot;https://tc39.es/ecma262/multipage/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://tc39.es/ecma262/multipage/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;HTML Standard 8.1 Scripting: &lt;a href=&quot;https://html.spec.whatwg.org/multipage/webappapis.html#scripting&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://html.spec.whatwg.org/multipage/webappapis.html#scripting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;MDN: &lt;a href=&quot;https://developer.mozilla.org/docs/Web/JavaScript&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://developer.mozilla.org/docs/Web/JavaScript&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/cargo</id>
<title type="text">Cargo</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/cargo" />
<published>2022-03-04T14:45:09.081Z</published>
<updated>2022-03-04T14:45:09.081Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The Cargo Book: &lt;a href=&quot;https://doc.rust-lang.org/cargo/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://doc.rust-lang.org/cargo/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;リポジトリ: &lt;a href=&quot;https://github.com/rust-lang/cargo/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/rust-lang/cargo/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/articles/2022-03-04-cargo-workspace</id>
<title type="text">Cargoのワークスペース</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/articles/2022-03-04-cargo-workspace" />
<published>2022-03-04T14:42:43.821Z</published>
<updated>2022-03-04T14:42:43.821Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Rust" /><category term="Cargo" />
<content type="html">&lt;p&gt;&lt;a href=&quot;https://www.rust-lang.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Rust&lt;/a&gt;のパッケージマネージャーである&lt;a href=&quot;https://doc.rust-lang.org/cargo&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Cargo&lt;/a&gt;には、複数のパッケージの依存パッケージのバージョンや、出力ディレクトリ、プロファイルなどの設定を共有できる&lt;a href=&quot;https://doc.rust-lang.org/cargo/reference/workspaces.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;ワークスペース&lt;/a&gt;機能がある。&lt;/p&gt;
&lt;h2 id=&quot;ワークスペースのマニフェスト&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ワークスペースのマニフェスト&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;ワークスペースのマニフェスト&lt;/h2&gt;
&lt;p&gt;ワークスペースは&lt;a href=&quot;https://doc.rust-lang.org/cargo/reference/workspaces.html#the-workspace-section&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;[workspace]&lt;/code&gt;&lt;/a&gt;セクションのある&lt;a href=&quot;https://doc.rust-lang.org/cargo/reference/manifest.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;Cargo.toml&lt;/code&gt;&lt;/a&gt;によって定義され、そのマニフェストファイルのあるディレクトリはワークスペースのルートディレクトリと呼ばれる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;toml&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;toml&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.toml&quot; href=&quot;data:text/plain;charset=utf-8;base64,W3dvcmtzcGFjZV0KbWVtYmVycyA9IFtdCmRlZmF1bHQtbWVtYmVycyA9IFtdCmV4Y2x1ZGUgPSBbXQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-toml&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;workspace&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;members = []&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;default-members = []&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;exclude = []&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;[workspace]&lt;/code&gt;セクションは&lt;a href=&quot;https://doc.rust-lang.org/cargo/reference/manifest.html#the-package-section&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;[package]&lt;/code&gt;&lt;/a&gt;セクションを持つパッケージのマニフェストにも追加可能で、その場合そのパッケージはワークスペースのルートパッケージと呼ばれる。反対に&lt;code&gt;[package]&lt;/code&gt;セクションを持たないワークスペースのマニフェストは、バーチャルマニフェストと呼ばれる。&lt;/p&gt;
&lt;h2 id=&quot;ワークスペースのメンバー&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ワークスペースのメンバー&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;ワークスペースのメンバー&lt;/h2&gt;
&lt;p&gt;ワークスペース内のパッケージは、ワークスペースのメンバーと呼ばれる。&lt;/p&gt;
&lt;p&gt;メンバーは&lt;code&gt;[workspace]&lt;/code&gt;セクションの&lt;code&gt;members&lt;/code&gt;キーで指定することができる（&lt;code&gt;?&lt;/code&gt;や&lt;code&gt;*&lt;/code&gt;などの&lt;a href=&quot;https://docs.rs/glob/0.3.0/glob/struct.Pattern.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;グロブパターン&lt;/a&gt;が使用可能）。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;toml&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;toml&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.toml&quot; href=&quot;data:text/plain;charset=utf-8;base64,W3dvcmtzcGFjZV0KbWVtYmVycyA9IFsicGF0aC90by9tZW1iZXIxIiwgIi4uL2V4dGVybmFsL21lbWJlcjIiLCAibWVtYmVycy8qIl0=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-toml&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;workspace&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;members = [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;path/to/member1&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;../external/member2&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;members/*&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;その他、ルートパッケージやメンバーのマニフェストに記載されている依存パッケージのうち、ワークスペースのルートディレクトリに含まれる&lt;code&gt;path&lt;/code&gt;によって指定されているもの（&lt;a href=&quot;https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html?#specifying-path-dependencies&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;path dependency&lt;/a&gt;）も、自動的にワークスペースのメンバーとなる。&lt;/p&gt;
&lt;p&gt;そのため、ルートパッケージの&lt;code&gt;[workspace]&lt;/code&gt;セクションが空となることもありうる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;toml&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;toml&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.toml&quot; href=&quot;data:text/plain;charset=utf-8;base64,W3BhY2thZ2VdCm5hbWUgPSAibXktcm9vdC1wYWNrYWdlIgp2ZXJzaW9uID0gIjAuMS4wIgoKW2RlcGVuZGVuY2llc10KbWVtYmVyMSA9IHsgcGF0aCA9ICIuL21lbWJlcjEiIH0KClt3b3Jrc3BhY2Vd&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-toml&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;package&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;name = &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;my-root-package&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;version = &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;0.1.0&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;dependencies&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;member1 = { path = &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;./member1&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;workspace&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;path&lt;/code&gt;による依存パッケージが自動でメンバーに追加されるのを防いだり、一部パッケージをグロブパターンから除外したりのするには、&lt;code&gt;exclude&lt;/code&gt;キーを使うことができる。なお&lt;code&gt;exclude&lt;/code&gt;ではグロブパターンは使えず、指定されたパス以下のすべてのパッケージがメンバーから除外される仕様になっている。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;toml&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;toml&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.toml&quot; href=&quot;data:text/plain;charset=utf-8;base64,W3dvcmtzcGFjZV0KbWVtYmVycyA9IFsiY3JhdGVzLyoiXQpleGNsdWRlID0gWyJjcmF0ZXMvYmFyIl0=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-toml&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;workspace&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;members = [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;crates/*&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;exclude = [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;crates/bar&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;ワークスペースの認識&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ワークスペースの認識&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;ワークスペースの認識&lt;/h2&gt;
&lt;p&gt;ワークスペースのマニフェストはCargoによって、自動的に親ディレクトリへと遡って探索される。ワークスペースのメンバーがルートディレクトリ外にある場合などのようにこの動作の上書きがしたい場合は、パッケージのマニフェストで&lt;a href=&quot;https://doc.rust-lang.org/cargo/reference/manifest.html#the-workspace-field&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;package.workspace&lt;/code&gt;&lt;/a&gt;キーを用いることで、パッケージの属するワークスペースを指定することができる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;toml&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;toml&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.toml&quot; href=&quot;data:text/plain;charset=utf-8;base64,W3BhY2thZ2VdCm5hbWUgPSAibWVtYmVyIgp2ZXJzaW9uID0gIjAuMS4wIgp3b3Jrc3BhY2UgPSAiLi4vLi4vcGF0aC90by93b3Jrc3BhY2Ui&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-toml&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;package&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;name = &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;member&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;version = &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;0.1.0&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;workspace = &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;../../path/to/workspace&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;ワークスペースの機能&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#ワークスペースの機能&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;ワークスペースの機能&lt;/h2&gt;
&lt;p&gt;ワークスペースによってメンバーは以下を共有することになる。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;依存パッケージの解決
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Cargo.lock&lt;/code&gt;ファイルはワークスペースのルートディレクトリにのみ置かれる&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;出力ディレクトリ
&lt;ul&gt;
&lt;li&gt;デフォルトではワークスペースのルートディレクトリ直下の&lt;code&gt;target&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Cargo.toml&lt;/code&gt;の&lt;a href=&quot;https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;[patch]&lt;/code&gt;&lt;/a&gt;、&lt;a href=&quot;https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-replace-section&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;[replace]&lt;/code&gt;&lt;/a&gt;、&lt;a href=&quot;https://doc.rust-lang.org/cargo/reference/profiles.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;[profile.*]&lt;/code&gt;&lt;/a&gt;セクション
&lt;ul&gt;
&lt;li&gt;ワークスペースのマニフェストのもののみが認識され、メンバーのマニフェストのものは無視される&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;toml&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;toml&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.toml&quot; href=&quot;data:text/plain;charset=utf-8;base64,W3dvcmtzcGFjZV0KbWVtYmVycyA9IFsiY3JhdGVzLyoiXQoKW3Byb2ZpbGVdCm9wdC1sZXZlbCA9IHM=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-toml&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;workspace&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;members = [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;crates/*&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;profile&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;opt-level = s&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;また、&lt;code&gt;cargo new&lt;/code&gt;や&lt;code&gt;cargo init&lt;/code&gt;で行われる&lt;code&gt;git&lt;/code&gt;リポジトリの初期化も、作成されるパッケージが属することになるワークスペースが既にバージョン管理されている場合は行われなくなる。&lt;/p&gt;
&lt;p&gt;そのほか&lt;a href=&quot;https://doc.rust-lang.org/cargo/reference/manifest.html#the-metadata-table&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;package.metadata&lt;/code&gt;&lt;/a&gt;と同様に&lt;a href=&quot;https://doc.rust-lang.org/cargo/reference/workspaces.html#the-workspacemetadata-table&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;workspace.metadata&lt;/code&gt;&lt;/a&gt;テーブルも許容されており、Cargo以外のツールが自由に使うことが可能となっている。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;toml&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;toml&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.toml&quot; href=&quot;data:text/plain;charset=utf-8;base64,W3dvcmtzcGFjZV0KbWVtYmVycyA9IFsiY3JhdGVzLyoiXQoKW3dvcmtzcGFjZS5tZXRhZGF0YS5zaXRlXQp0aXRsZSA9ICJQcm9qZWN0IFNpdGUiCmljb24gPSB7IHBhdGggPSAiaWNvbi5wbmciIH0=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-toml&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;workspace&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;members = [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;crates/*&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;workspace&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;metadata&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;site&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;title = &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Project Site&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;icon = { path = &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;icon.png&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; }&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;cliのオプション&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#cliのオプション&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;CLIのオプション&lt;/h2&gt;
&lt;p&gt;Cargoのコマンドでは、&lt;code&gt;-p&lt;/code&gt;（&lt;code&gt;--package&lt;/code&gt;）オブションを使うことで、カレントディレクトリが属するワークスペース内にあるパッケージを指定することができる。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,Y2FyZ28gcnVuIC1wIG1lbWJlcjE=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;cargo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -p&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; member1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;また&lt;code&gt;--workspace&lt;/code&gt;オプションを使うと、カレントディレクトリが属するワークスペース内にあるすべてのパッケージを対象に、そのコマンドが実行される。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,Y2FyZ28gdGVzdCAtLXdvcmtzcGFjZQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;cargo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; test&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --workspace&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;何も指定しなかった場合は、カレントディレクトリが属するパッケージに対して、コマンドが実行される（メンバーのディレクトリ内ではない場合は、ルートパッケージ）。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,Y2FyZ28gYnVpbGQ=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;cargo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; build&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;属するパッケージがなく、代わりにバーチャルマニフェストに属するディレクトリで実行した場合は、デフォルトでは&lt;code&gt;--workspace&lt;/code&gt;を指定した場合と同様に振る舞うが、&lt;code&gt;default-members&lt;/code&gt;キーを用いるとその際実行されるメンバーを指定しておくことができる。なお&lt;code&gt;default-members&lt;/code&gt;でもグロブパターンは使えるが、メンバーに含まれないパッケージが選択されることはない。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;toml&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;toml&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.toml&quot; href=&quot;data:text/plain;charset=utf-8;base64,W3dvcmtzcGFjZV0KbWVtYmVycyA9IFsiY3JhdGVzLyoiLCAib3RoZXJzLyoiXQpkZWZhdWx0LW1lbWJlcnMgPSBbImNyYXRlcy8qIl0KZXhjbHVkZSA9IFsiY3JhdGVzL2JhciJd&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-toml&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;workspace&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;members = [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;crates/*&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;others/*&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;default-members = [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;crates/*&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;exclude = [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;crates/bar&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;参考&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#参考&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;参考&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://doc.rust-lang.org/cargo/reference/workspaces.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://doc.rust-lang.org/cargo/reference/workspaces.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-03-02-rust-slogan</id>
<title type="text">Rustのスローガンが「効率的で信頼できるソフトウェアを誰もがつくれる言語」になったタイミング</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-03-02-rust-slogan" />
<published>2022-03-02T20:40:09.848Z</published>
<updated>2022-03-02T20:40:09.848Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Rust" />
<content type="html">&lt;p&gt;&lt;a href=&quot;https://blog.rust-lang.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;Rust Blog&lt;/a&gt;の2018-11-29の記事「&lt;a href=&quot;https://blog.rust-lang.org/2018/11/29/a-new-look-for-rust-lang-org.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;A new look for rust-lang.org&lt;/a&gt;」に次の記載がある:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We have also revised the slogan. Historically, it has been:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Like the bullet list of features, this doesn&#39;t convey what you can do with Rust. So we&#39;ve updated the slogan:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Rust: The programming language that empowers everyone to become a systems programmer.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;p&gt;ここで「システムプログラミング言語」としてのRustから、現在の「効率的で信頼できるソフトウェアを誰もがつくれる言語（A language empowering everyone
to build reliable and efficient software.）」としてのRustに変わったらしい。&lt;/p&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-03-01-monaco-editor-webpack</id>
<title type="text">Monaco Editorをwebpackのプロジェクトに追加する</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-03-01-monaco-editor-webpack" />
<published>2022-03-01T17:43:22.787Z</published>
<updated>2022-03-01T14:47:18.358Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Monaco Editor" /><category term="webpack" />
<content type="html">&lt;p&gt;&lt;a href=&quot;https://github.com/microsoft/monaco-editor/tree/main/webpack-plugin&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;monaco-editor-webpack-plugin&lt;/code&gt;&lt;/a&gt;を使うのが簡単:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bnBtIGkgLUQgbW9uYWNvLWVkaXRvci13ZWJwYWNrLXBsdWdpbg==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; i&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -D&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; monaco-editor-webpack-plugin&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;次のようにプラグインとして追加するだけで、勝手に設定してくれる:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;js&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;js&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.js&quot; href=&quot;data:text/plain;charset=utf-8;base64,Y29uc3QgTW9uYWNvRWRpdG9yV2VicGFja1BsdWdpbiA9IHJlcXVpcmUoIm1vbmFjby1lZGl0b3Itd2VicGFjay1wbHVnaW4iKQoKbW9kdWxlLmV4cG9ydHMgPSB7CiAgICBwbHVnaW5zOiBbbmV3IE1vbmFjb0VkaXRvcldlYnBhY2tQbHVnaW4oKV0sCn0=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; MonacoEditorWebpackPlugin&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; require&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;monaco-editor-webpack-plugin&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;module&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;exports&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    plugins: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; MonacoEditorWebpackPlugin&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;()],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;プレビュー用にここでは以下を追加:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bnBtIGkgLUQgd2VicGFjay1jbGkgd2VicGFjay1kZXYtc2VydmVyIGh0bWwtd2VicGFjay1wbHVnaW4=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; i&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -D&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; webpack-cli&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; webpack-dev-server&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; html-webpack-plugin&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;webpack.config.js&lt;/code&gt;:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;js&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;js&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.js&quot; href=&quot;data:text/plain;charset=utf-8;base64,Y29uc3QgcGF0aCA9IHJlcXVpcmUoInBhdGgiKQpjb25zdCBNb25hY29FZGl0b3JXZWJwYWNrUGx1Z2luID0gcmVxdWlyZSgibW9uYWNvLWVkaXRvci13ZWJwYWNrLXBsdWdpbiIpCmNvbnN0IEh0bWxXZWJwYWNrUGx1Z2luID0gcmVxdWlyZSgiaHRtbC13ZWJwYWNrLXBsdWdpbiIpCgptb2R1bGUuZXhwb3J0cyA9IHsKICAgIGVudHJ5OiBwYXRoLnJlc29sdmUoX19kaXJuYW1lLCAic3JjIiwgImluZGV4LmpzIiksCiAgICBwbHVnaW5zOiBbbmV3IE1vbmFjb0VkaXRvcldlYnBhY2tQbHVnaW4oKSwgbmV3IEh0bWxXZWJwYWNrUGx1Z2luKCldLAogICAgLy8gd2VicGFjayA2IOOBp+OBr+OBhOOCieOBquOBj+OBquOCi+OBr+OBmjoKICAgIGV4cGVyaW1lbnRzOiB7CiAgICAgICAgY3NzOiB0cnVlLAogICAgfSwKfQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; path&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; require&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; MonacoEditorWebpackPlugin&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; require&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;monaco-editor-webpack-plugin&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; HtmlWebpackPlugin&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; require&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;html-webpack-plugin&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;module&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;exports&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    entry: path.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;resolve&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(__dirname, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;src&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;index.js&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    plugins: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; MonacoEditorWebpackPlugin&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(), &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; HtmlWebpackPlugin&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;()],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;    // webpack 6 ではいらなくなるはず:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    experiments: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        css: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;例えば次のようなJavaScriptとCSSを読み込むと:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;src/index.js&lt;/code&gt;&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;js&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;js&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.js&quot; href=&quot;data:text/plain;charset=utf-8;base64,aW1wb3J0ICogYXMgbW9uYWNvIGZyb20gIm1vbmFjby1lZGl0b3IiCmltcG9ydCAiLi9pbmRleC5jc3MiCgptb25hY28uZWRpdG9yLmNyZWF0ZSgKICAgIGRvY3VtZW50LmJvZHkuYXBwZW5kQ2hpbGQoZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgiZGl2IikpLAogICAgewogICAgICAgIGxhbmd1YWdlOiAiamF2YXNjcmlwdCIsCiAgICAgICAgdmFsdWU6IGBjb25zb2xlLmxvZygiSGVsbG8sIOS4lueVjCIpYCwKICAgIH0KKQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-js&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; *&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; as&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; monaco &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;monaco-editor&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;./index.css&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;monaco.editor.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;create&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    document.body.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;appendChild&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(document.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;createElement&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;div&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)),&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        language: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        value: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;`console.log(&quot;Hello, 世界&quot;)`&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;&lt;code&gt;src/index.css&lt;/code&gt;&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;css&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;css&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.css&quot; href=&quot;data:text/plain;charset=utf-8;base64,aHRtbCwKYm9keSwKYm9keSA+IGRpdiB7CiAgICBoZWlnaHQ6IDEwMCU7Cn0=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;html&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;body&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt; div&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    height&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;100&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;%&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;画面いっぱいにMonaco Editorが表示されるはず:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;bash&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;bash&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,d2VicGFjayBzZXJ2ZSAtLW1vZGUgZGV2ZWxvcG1lbnQ=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-bash&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;webpack&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; serve&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; --mode&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; development&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/monaco-editor</id>
<title type="text">Monaco Editor</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/monaco-editor" />
<published>2022-03-01T17:43:22.787Z</published>
<updated>2022-03-01T14:50:50.870Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式サイト: &lt;a href=&quot;https://microsoft.github.io/monaco-editor/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://microsoft.github.io/monaco-editor/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;リポジトリ: &lt;a href=&quot;https://github.com/microsoft/monaco-editor&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/microsoft/monaco-editor&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;API: &lt;a href=&quot;https://microsoft.github.io/monaco-editor/api/index.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://microsoft.github.io/monaco-editor/api/index.html&lt;/a&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/microsoft/monaco-editor/blob/main/website/typedoc/monaco.d.ts&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;monaco.d.ts&lt;/code&gt;&lt;/a&gt;が生成元&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/webpack</id>
<title type="text">webpack</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/webpack" />
<published>2022-03-01T17:43:22.787Z</published>
<updated>2022-03-01T15:11:59.595Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式サイト: &lt;a href=&quot;https://webpack.js.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://webpack.js.org/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;リポジトリ: &lt;a href=&quot;https://github.com/webpack/webpack&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/webpack/webpack&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-03-01-rfc2119</id>
<title type="text">RFC 2119: RFCにおいて要求レベルを示すために用いるキーワード</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-03-01-rfc2119" />
<published>2022-03-01T07:59:17.799Z</published>
<updated>2022-03-01T07:09:44.432Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="RFC" />
<content type="html">&lt;p&gt;RFC 2119は、各種RFCにおいて次の用語や表現がどの程度の要求レベルを示すと解釈されるべきかを定義している。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;MUST&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;MUST NOT&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;REQUIRED&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SHALL&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SHALL NOT&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SHOULD&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SHOULD NOT&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;RECOMMENDED&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;MAY&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;OPTIONAL&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;すべてのRFCがこの解釈に従うわけではないが、多くのRFCがこのRFCを参照することで、表現を厳密に解釈できるようにしている。&lt;/p&gt;
&lt;p&gt;本文は:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://datatracker.ietf.org/doc/html/rfc2119&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://datatracker.ietf.org/doc/html/rfc2119&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;日本語訳には、たとえば:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.ipa.go.jp/security/rfc/RFC2119JA.html&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.ipa.go.jp/security/rfc/RFC2119JA.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;なお&lt;a href=&quot;https://datatracker.ietf.org/doc/html/rfc8174&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;RFC 8174&lt;/a&gt;は大文字で表記されている場合のみRFC 2119の意味で解釈することで曖昧さをなくそうというRFCであり、RFC 2119とともに参照されることが多い。&lt;/p&gt;
&lt;h2 id=&quot;しなければならない必要&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#しなければならない必要&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;しなければならない（必要）&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;MUST&lt;/code&gt;（「しなければならない」）&lt;/li&gt;
&lt;li&gt;&lt;code&gt;REQUIRED&lt;/code&gt;（「要求される」）&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SHALL&lt;/code&gt;（「することになる」）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;は仕様を満たすには絶対必要であることを示す。&lt;/p&gt;
&lt;p&gt;強い要求なので、この表現を用いる場合は、細心の注意が必要となる。&lt;/p&gt;
&lt;h2 id=&quot;してはならない禁止&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#してはならない禁止&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;してはならない（禁止）&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;MUST NOT&lt;/code&gt;（「してはならない」）&lt;/li&gt;
&lt;li&gt;&lt;code&gt;SHALL NOT&lt;/code&gt;（「することはない」）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;は仕様を満たすには絶対禁止であることを示す。&lt;/p&gt;
&lt;p&gt;強い要求なので、この表現を用いる場合は、細心の注意が必要となる。&lt;/p&gt;
&lt;h2 id=&quot;すべきである推奨&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#すべきである推奨&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;すべきである（推奨）&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;SHOULD&lt;/code&gt;（「すべきである」）&lt;/li&gt;
&lt;li&gt;&lt;code&gt;RECOMMENDED&lt;/code&gt;（「推奨される」）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;は特定の条件における正当な理由なく、その項目を無視してはならないことを示す。&lt;/p&gt;
&lt;p&gt;その項目を無視するには、細心の注意が必要となる。&lt;/p&gt;
&lt;h2 id=&quot;すべきでない非推奨&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#すべきでない非推奨&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;すべきでない（非推奨）&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;SHOULD NOT&lt;/code&gt;（「すべきでない」）&lt;/li&gt;
&lt;li&gt;&lt;code&gt;NOT RECOMMENDED&lt;/code&gt;（「推奨されない」）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;は特定の条件における正当な理由なく、その項目を満たしてはならないことを示す。&lt;/p&gt;
&lt;p&gt;その項目を満たすには、細心の注意が必要となる。&lt;/p&gt;
&lt;h2 id=&quot;してもよい任意&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#してもよい任意&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;してもよい（任意）&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;MAY&lt;/code&gt;（「してもよい」）&lt;/li&gt;
&lt;li&gt;&lt;code&gt;OPTIONAL&lt;/code&gt;（「任意である」）&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;は、その項目を満たすか満たさないかが実装者に任されることを示す。&lt;/p&gt;
&lt;p&gt;逆にいえば、その項目を満たしてる実装も満たしていない実装も両方仕様を満たしているものとして正当に扱わなければならない。&lt;/p&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/rfc</id>
<title type="text">RFC</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/rfc" />
<published>2022-03-01T07:59:17.799Z</published>
<updated>2022-03-01T07:55:30.110Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.ietf.org/standards/rfcs/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.ietf.org/standards/rfcs/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.rfc-editor.org&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.rfc-editor.org&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-02-26-cloudflare-pages-err-unsupported-esm-url-scheme</id>
<title type="text">Cloudflare Pagesでエラー`Only file and data URLs are supported by the default ESM loader`がでる</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-02-26-cloudflare-pages-err-unsupported-esm-url-scheme" />
<published>2022-02-26T08:54:37.708Z</published>
<updated>2022-02-26T08:54:37.708Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Cloudflare" /><category term="Cloudflare Pages" />
<content type="html">&lt;p&gt;Cloudflare PagesでNode.jsのプロジェクトをビルドする際に、次のようなエラーが出た。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;txt&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;txt&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.txt&quot; href=&quot;data:text/plain;charset=utf-8;base64,RXJyb3IgW0VSUl9VTlNVUFBPUlRFRF9FU01fVVJMX1NDSEVNRV06IE9ubHkgZmlsZSBhbmQgZGF0YSBVUkxzIGFyZSBzdXBwb3J0ZWQgYnkgdGhlIGRlZmF1bHQgRVNNIGxvYWRlcg==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-txt&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;原因はどうやら現時点でのCloudflare PagesのデフォルトのNode.jsのバージョンが&lt;a href=&quot;https://developers.cloudflare.com/pages/platform/build-configuration/#language-support-and-tools&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;&lt;code&gt;12.18.0&lt;/code&gt;である&lt;/a&gt;ことだったようなので、環境変数の&lt;code&gt;NODE_VERSION&lt;/code&gt;をひとまず&lt;code&gt;16&lt;/code&gt;に設定すると解決した。&lt;/p&gt;
&lt;p&gt;なお&lt;code&gt;.nvmrc&lt;/code&gt;や&lt;code&gt;.node-version&lt;/code&gt;などのファイルもサポートされているので、これで指定しておくとより取り回しがきくかもしれない。&lt;/p&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/cloudflare</id>
<title type="text">Cloudflare</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/cloudflare" />
<published>2022-02-26T08:54:37.708Z</published>
<updated>2022-02-13T15:27:26.730Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式サイト: &lt;a href=&quot;https://www.cloudflare.com/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.cloudflare.com/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/cloudflare-pages</id>
<title type="text">Cloudflare Pages</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/cloudflare-pages" />
<published>2022-02-26T08:54:37.708Z</published>
<updated>2022-02-26T08:56:23.019Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式サイト: &lt;a href=&quot;https://pages.cloudflare.com/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://pages.cloudflare.com/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/husky</id>
<title type="text">husky</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/husky" />
<published>2022-02-26T08:11:40.016Z</published>
<updated>2022-02-26T08:11:40.016Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式サイト: &lt;a href=&quot;https://typicode.github.io/husky/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://typicode.github.io/husky/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;リポジトリ: &lt;a href=&quot;https://github.com/typicode/husky&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/typicode/husky&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-02-26-add-husky</id>
<title type="text">`husky`を追加する</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-02-26-add-husky" />
<published>2022-02-26T08:11:05.392Z</published>
<updated>2022-02-26T08:11:05.392Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="husky" />
<content type="html">&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bnBtIGluc3RhbGwgaHVza3kgLUQ=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; install&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; husky&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -D&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bnBtIHNldC1zY3JpcHQgcHJlcGFyZSAiaHVza3kgaW5zdGFsbCIKbnBtIHJ1biBwcmVwYXJl&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; set-script&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; prepare&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;husky install&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; run&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; prepare&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bnB4IGh1c2t5IGFkZCAuaHVza3kvcHJlLWNvbW1pdCAibnBtIHJ1biBwcmVjb21taXQi&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; husky&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; add&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; .husky/pre-commit&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;npm run precommit&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;例えば、&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;shell&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;shell&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.sh&quot; href=&quot;data:text/plain;charset=utf-8;base64,bnBtIHNldC1zY3JpcHQgcHJlY29tbWl0ICJucG0gcnVuIGNoZWNrICYmIG5wbSBydW4gbGludCAmJiBucG0gcnVuIGZvcm1hdCI=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-shell&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; set-script&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; precommit&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;npm run check &amp;#x26;&amp;#x26; npm run lint &amp;#x26;&amp;#x26; npm run format&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/privacy</id>
<title type="text">プライバシーポリシー</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/privacy" />
<published>2022-02-16T11:28:12.186Z</published>
<updated>2022-02-16T11:33:45.416Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text">プライバシーポリシーについてはこちらをご覧ください。</summary>

<content type="html">&lt;p&gt;本サイトはGoogleの提供するGoogleアナリティクスを利用しています。&lt;/p&gt;
&lt;h2 id=&quot;googleアナリティクス&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#googleアナリティクス&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;Googleアナリティクス&lt;/h2&gt;
&lt;p&gt;本サイトはGoogleの提供するGoogleアナリティクスを利用しています。またそれによって、Cookie、モバイルデバイスの識別情報（Android の広告識別子、iOS の広告識別子など）、およびその他データの収集に使われる類似の技術なども利用しています。Googleアナリティクスでデータが収集、処理される仕組みについては、「&lt;a href=&quot;https://www.google.com/intl/ja/policies/privacy/partners/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;ユーザーが Google パートナーのサイトやアプリを使用する際の Google によるデータ使用&lt;/a&gt;」をご覧ください。&lt;/p&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/tags/rust</id>
<title type="text">Rust</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/tags/rust" />
<published>2022-02-13T15:27:42.376Z</published>
<updated>2022-02-13T15:27:42.376Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>

<content type="html">&lt;h2 id=&quot;リンク&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#リンク&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;リンク&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;公式サイト: &lt;a href=&quot;https://www.rust-lang.org/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.rust-lang.org/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;リポジトリ: &lt;a href=&quot;https://github.com/rust-lang/rust&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;https://github.com/rust-lang/rust&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-02-13-rust-include-str-doc</id>
<title type="text">RustでREADME.mdをドキュメントコメントとしてインクルードする</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-02-13-rust-include-str-doc" />
<published>2022-02-13T15:25:26.303Z</published>
<updated>2022-02-13T15:25:26.303Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Rust" />
<content type="html">&lt;figure data-code-block=&quot;&quot; data-language=&quot;rust&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;rust&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.rs&quot; href=&quot;data:text/plain;charset=utf-8;base64,IyFbZG9jID0gaW5jbHVkZV9zdHIhKCIuLi9SRUFETUUubWQiKV0=&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-rust&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;#![doc &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; include_str&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;!&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;../README.md&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content>
</entry>
<entry>
<id>https://blog.publictheta.com/memos/2022-02-13-rust-str-distance</id>
<title type="text">Rustで文字列スライスのポインタ間の距離を測る</title>
<link rel="alternate" type="text/html" href="https://blog.publictheta.com/memos/2022-02-13-rust-str-distance" />
<published>2022-02-13T15:24:44.489Z</published>
<updated>2022-05-29T13:58:22.415Z</updated>
<author><name>Public Theta</name><uri>https://publictheta.com</uri></author>
<summary type="text"></summary>
<category term="Rust" />
<content type="html">&lt;figure data-code-block=&quot;&quot; data-language=&quot;rust&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;rust&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.rs&quot; href=&quot;data:text/plain;charset=utf-8;base64,cHViIGZuIGRpc3RhbmNlX3B0cihhOiAmc3RyLCBiOiAmc3RyKSAtPiB1c2l6ZSB7CiAgICAoYi5hc19wdHIoKSBhcyB1c2l6ZSkgLSAoYS5hc19wdHIoKSBhcyB1c2l6ZSkKfQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-rust&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;pub&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; fn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; distance_ptr&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(a&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &amp;#x26;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, b&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &amp;#x26;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; usize&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    (b&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;as_ptr&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; usize&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; (a&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;as_ptr&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; usize&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;p&gt;コンパイルすると:&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;asm&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;asm&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.asm&quot; href=&quot;data:text/plain;charset=utf-8;base64,bW92cSAlcmR4LCAlcmF4CnN1YnEgJXJkaSwgJXJheApyZXRx&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-asm&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;movq&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; %&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;rdx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, %&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;rax&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;subq %&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;rdi&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, %&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;rax&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;retq&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;
&lt;h2 id=&quot;補足&quot;&gt;&lt;a aria-hidden=&quot;true&quot; tabindex=&quot;-1&quot; href=&quot;#補足&quot;&gt;&lt;span class=&quot;icon icon-link&quot;&gt;&lt;/span&gt;&lt;/a&gt;補足&lt;/h2&gt;
&lt;p&gt;これを使うと、ある文字列（&lt;code&gt;source&lt;/code&gt;）に対してその部分文字列（&lt;code&gt;span&lt;/code&gt;）がどの位置や範囲にあるかを、追加情報なしに取得することができるはず（安全な操作かどうかは正直なところ分からない）。&lt;/p&gt;
&lt;p&gt;なお&lt;code&gt;_unwrap&lt;/code&gt;のついている関数では、&lt;code&gt;span&lt;/code&gt;として与えられた文字列スライスが本当に&lt;code&gt;source&lt;/code&gt;の範囲内にあるかを確認して&lt;code&gt;Option&lt;/code&gt;で返すようになっている。&lt;/p&gt;
&lt;figure data-code-block=&quot;&quot; data-language=&quot;rust&quot;&gt;&lt;figcaption&gt;&lt;span class=&quot;code-block-language&quot;&gt;rust&lt;/span&gt;&lt;div class=&quot;code-block-actions&quot;&gt;&lt;a download=&quot;code.rs&quot; href=&quot;data:text/plain;charset=utf-8;base64,Zm4gcG9zaXRpb25fcHRyX3Vud3JhcChzb3VyY2U6ICZzdHIsIHNwYW46ICZzdHIpIC0+IHVzaXplIHsKICAgIGxldCBzb3VyY2Vfc3RhcnQgPSBzb3VyY2UuYXNfcHRyKCkgYXMgdXNpemU7CiAgICBsZXQgc3Bhbl9zdGFydCA9IHNwYW4uYXNfcHRyKCkgYXMgdXNpemU7CiAgICBzcGFuX3N0YXJ0IC0gc291cmNlX3N0YXJ0Cn0KCmZuIHBvc2l0aW9uX3B0cihzb3VyY2U6ICZzdHIsIHNwYW46ICZzdHIpIC0+IE9wdGlvbjx1c2l6ZT4gewogICAgbGV0IHNvdXJjZV9zdGFydCA9IHNvdXJjZS5hc19wdHIoKSBhcyB1c2l6ZTsKICAgIGxldCBzcGFuX3N0YXJ0ID0gc3Bhbi5hc19wdHIoKSBhcyB1c2l6ZTsKCiAgICBpZiBzcGFuX3N0YXJ0IDwgc291cmNlX3N0YXJ0IHsKICAgICAgICByZXR1cm4gTm9uZTsKICAgIH0KCiAgICBsZXQgc291cmNlX2VuZCA9IHNvdXJjZV9zdGFydC5jaGVja2VkX2FkZChzb3VyY2UubGVuKCkpPzsKICAgIGxldCBzcGFuX2VuZCA9IHNwYW5fc3RhcnQuY2hlY2tlZF9hZGQoc3Bhbi5sZW4oKSk/OwoKICAgIGlmIHNvdXJjZV9lbmQgPCBzcGFuX2VuZCB7CiAgICAgICAgcmV0dXJuIE5vbmU7CiAgICB9CgogICAgU29tZShzcGFuX3N0YXJ0IC0gc291cmNlX3N0YXJ0KQp9CgpmbiByYW5nZV9wdHJfdW53cmFwKHNvdXJjZTogJnN0ciwgc3BhbjogJnN0cikgLT4gY29yZTo6b3BzOjpSYW5nZTx1c2l6ZT4gewogICAgbGV0IHNvdXJjZV9zdGFydCA9IHNvdXJjZS5hc19wdHIoKSBhcyB1c2l6ZTsKICAgIGxldCBzcGFuX3N0YXJ0ID0gc3Bhbi5hc19wdHIoKSBhcyB1c2l6ZTsKICAgIGxldCByYW5nZV9zdGFydCA9IHNwYW5fc3RhcnQgLSBzb3VyY2Vfc3RhcnQ7CiAgICByYW5nZV9zdGFydC4uKHJhbmdlX3N0YXJ0ICsgc3Bhbi5sZW4oKSkKfQoKZm4gcmFuZ2VfcHRyKHNvdXJjZTogJnN0ciwgc3BhbjogJnN0cikgLT4gT3B0aW9uPGNvcmU6Om9wczo6UmFuZ2U8dXNpemU+PiB7CiAgICBsZXQgc291cmNlX3N0YXJ0ID0gc291cmNlLmFzX3B0cigpIGFzIHVzaXplOwogICAgbGV0IHNwYW5fc3RhcnQgPSBzcGFuLmFzX3B0cigpIGFzIHVzaXplOwoKICAgIGlmIHNwYW5fc3RhcnQgPCBzb3VyY2Vfc3RhcnQgewogICAgICAgIHJldHVybiBOb25lOwogICAgfQoKICAgIGxldCBzb3VyY2VfZW5kID0gc291cmNlX3N0YXJ0LmNoZWNrZWRfYWRkKHNvdXJjZS5sZW4oKSk/OwogICAgbGV0IHNwYW5fZW5kID0gc3Bhbl9zdGFydC5jaGVja2VkX2FkZChzcGFuLmxlbigpKT87CgogICAgaWYgc291cmNlX2VuZCA8IHNwYW5fZW5kIHsKICAgICAgICByZXR1cm4gTm9uZTsKICAgIH0KCiAgICBsZXQgcmFuZ2Vfc3RhcnQgPSBzcGFuX3N0YXJ0IC0gc291cmNlX3N0YXJ0OwogICAgbGV0IHJhbmdlID0gcmFuZ2Vfc3RhcnQuLihyYW5nZV9zdGFydCArIHNwYW4ubGVuKCkpOwogICAgU29tZShyYW5nZSkKfQ==&quot; class=&quot;code-block-action code-block-download&quot; aria-label=&quot;Download code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;↓&lt;/span&gt;&lt;/a&gt;&lt;button type=&quot;button&quot; class=&quot;code-block-action code-block-copy&quot; aria-label=&quot;Copy code&quot;&gt;&lt;span class=&quot;icon&quot; aria-hidden=&quot;true&quot;&gt;⎘&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;/figcaption&gt;&lt;pre class=&quot;shiki shiki-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e&quot; tabindex=&quot;0&quot;&gt;&lt;code class=&quot;language-rust&quot;&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;fn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; position_ptr_unwrap&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(source&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &amp;#x26;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, span&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &amp;#x26;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; usize&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source_start &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;as_ptr&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; usize&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span_start &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;as_ptr&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; usize&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    span_start &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source_start&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;fn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; position_ptr&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(source&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &amp;#x26;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, span&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &amp;#x26;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Option&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;usize&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source_start &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;as_ptr&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; usize&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span_start &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;as_ptr&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; usize&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span_start &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source_start {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;        return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; None&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source_end &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source_start&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;checked_add&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(source&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;())&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span_end &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span_start&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;checked_add&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(span&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;())&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source_end &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span_end {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;        return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; None&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    Some&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(span_start &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source_start)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;fn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; range_ptr_unwrap&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(source&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &amp;#x26;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, span&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &amp;#x26;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; core&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;ops&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;Range&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;usize&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source_start &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;as_ptr&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; usize&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span_start &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;as_ptr&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; usize&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; range_start &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span_start &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source_start;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    range_start&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;..&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(range_start &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;())&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;fn&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; range_ptr&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(source&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &amp;#x26;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, span&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &amp;#x26;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;-&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Option&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;core&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;ops&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;::&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;Range&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;usize&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source_start &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;as_ptr&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; usize&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span_start &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;as_ptr&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;() &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; usize&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span_start &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source_start {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;        return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; None&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source_end &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source_start&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;checked_add&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(source&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;())&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span_end &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span_start&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;checked_add&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(span&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;())&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    if&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source_end &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span_end {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;        return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; None&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; range_start &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span_start &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; source_start;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;    let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; range &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; range_start&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;..&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(range_start &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; span&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;());&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;    Some&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(range)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;</content>
</entry>
</feed>