<p dir="auto">Both <code class="notranslate">Request.prototype[_mimeType]</code> and <code class="notranslate">Response.prototype[_mimeType]</code> implement the <a href="https://fetch.spec.whatwg.org/#concept-header-extract-mime-type" rel="nofollow">extract a MIME type</a> algorithm. These should be deduplicated.</p>
<p dir="auto">In fact, it would make sense to implement this algorithm in <code class="notranslate">ext/web/01_mimesniff.js</code>, taking <code class="notranslate">values</code> as its argument rather than a header list.</p>
<p dir="auto"><code class="notranslate">DenoCompiler.madeDefine()</code> can be improved, where there is some duplication of code for the <code class="notranslate">localRequire</code> and what is used when resolving dependencies in the <code class="notranslate">define</code>.</p>
<p dir="auto">The reason we support <code class="notranslate">require</code> as a dependency is to facilitate compatibility with ES dynamic <code class="notranslate">import()</code>.  The way TypeScript accomplishes this is by using a <a href="https://github.com/amdjs/amdjs-api/blob/master/require.md">non-AMD specified</a> optional third argument for local <code class="notranslate">require</code>.  This is used to "reject" the <code class="notranslate">Promise</code> that is used to resolve the require.  The third argument was implemented by RequireJS but never added to the spec.  Technically the local require we have implemented doesn't support returning immediately with already resolved dependencies either, so the only thing that it is good for is facilitating TypeScript emitting ES dynamic <code class="notranslate">import()</code>, therefore we should just make <code class="notranslate">errback</code> a mandatory argument.</p>