Skip to content

Commit

Permalink
2.0.1 tag
Browse files Browse the repository at this point in the history
  • Loading branch information
elbywan committed Aug 2, 2022
1 parent b6a1258 commit 4c4838d
Show file tree
Hide file tree
Showing 68 changed files with 261 additions and 130 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
<a name="2.0.1"></a>
## [2.0.1](https://github.com/elbywan/wretch/compare/2.0.0...2.0.1) (2022-08-02)


### :arrow_up: Version update(s)

* Add unpkg field to map to the right bundle. ([ae87b64](https://github.com/elbywan/wretch/commit/ae87b64))
* Upgrade dependencies. ([b6a1258](https://github.com/elbywan/wretch/commit/b6a1258))

### :memo: Documentation update(s)

* Update cdn links. ([7571101](https://github.com/elbywan/wretch/commit/7571101))



<a name="2.0.0"></a>
# [2.0.0](https://github.com/elbywan/wretch/compare/2.0.0-next.1...2.0.0) (2022-08-01)

Expand Down
2 changes: 1 addition & 1 deletion docs/api/assets/search.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/api/assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ a.tsd-index-link {
margin: 2rem 0;
}
.tsd-panel-group.tsd-index-group details {
margin: 4rem 0;
margin: 2rem 0;
}

#tsd-search {
Expand Down
4 changes: 3 additions & 1 deletion docs/api/functions/addons_abort.default.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ <h1>Function default</h1></div>
<pre><code class="language-js"><span class="hl-8">import</span><span class="hl-2"> </span><span class="hl-6">AbortAddon</span><span class="hl-2"> </span><span class="hl-8">from</span><span class="hl-2"> </span><span class="hl-5">&quot;wretch/addons/abort&quot;</span><br/><br/><span class="hl-1">const</span><span class="hl-2"> [</span><span class="hl-3">c</span><span class="hl-2">, </span><span class="hl-3">w</span><span class="hl-2">] = </span><span class="hl-4">wretch</span><span class="hl-2">(</span><span class="hl-5">&quot;...&quot;</span><span class="hl-2">)</span><br/><span class="hl-2"> .</span><span class="hl-4">addon</span><span class="hl-2">(</span><span class="hl-4">AbortAddon</span><span class="hl-2">())</span><br/><span class="hl-2"> .</span><span class="hl-4">get</span><span class="hl-2">()</span><br/><span class="hl-2"> .</span><span class="hl-4">onAbort</span><span class="hl-2">((</span><span class="hl-6">_</span><span class="hl-2">) </span><span class="hl-1">=&gt;</span><span class="hl-2"> </span><span class="hl-6">console</span><span class="hl-2">.</span><span class="hl-4">log</span><span class="hl-2">(</span><span class="hl-5">&quot;Aborted !&quot;</span><span class="hl-2">))</span><br/><span class="hl-2"> .</span><span class="hl-4">controller</span><span class="hl-2">();</span><br/><br/><span class="hl-6">w</span><span class="hl-2">.</span><span class="hl-4">text</span><span class="hl-2">((</span><span class="hl-6">_</span><span class="hl-2">) </span><span class="hl-1">=&gt;</span><span class="hl-2"> </span><span class="hl-6">console</span><span class="hl-2">.</span><span class="hl-4">log</span><span class="hl-2">(</span><span class="hl-5">&quot;should never be called&quot;</span><span class="hl-2">));</span><br/><span class="hl-6">c</span><span class="hl-2">.</span><span class="hl-4">abort</span><span class="hl-2">();</span><br/><br/><span class="hl-0">// Or :</span><br/><br/><span class="hl-1">const</span><span class="hl-2"> </span><span class="hl-3">controller</span><span class="hl-2"> = </span><span class="hl-1">new</span><span class="hl-2"> </span><span class="hl-4">AbortController</span><span class="hl-2">();</span><br/><br/><span class="hl-4">wretch</span><span class="hl-2">(</span><span class="hl-5">&quot;...&quot;</span><span class="hl-2">)</span><br/><span class="hl-2"> .</span><span class="hl-4">addon</span><span class="hl-2">(</span><span class="hl-4">AbortAddon</span><span class="hl-2">())</span><br/><span class="hl-2"> .</span><span class="hl-4">signal</span><span class="hl-2">(</span><span class="hl-6">controller</span><span class="hl-2">)</span><br/><span class="hl-2"> .</span><span class="hl-4">get</span><span class="hl-2">()</span><br/><span class="hl-2"> .</span><span class="hl-4">onAbort</span><span class="hl-2">((</span><span class="hl-6">_</span><span class="hl-2">) </span><span class="hl-1">=&gt;</span><span class="hl-2"> </span><span class="hl-6">console</span><span class="hl-2">.</span><span class="hl-4">log</span><span class="hl-2">(</span><span class="hl-5">&quot;Aborted !&quot;</span><span class="hl-2">))</span><br/><span class="hl-2"> .</span><span class="hl-4">text</span><span class="hl-2">((</span><span class="hl-6">_</span><span class="hl-2">) </span><span class="hl-1">=&gt;</span><span class="hl-2"> </span><span class="hl-6">console</span><span class="hl-2">.</span><span class="hl-4">log</span><span class="hl-2">(</span><span class="hl-5">&quot;should never be called&quot;</span><span class="hl-2">));</span><br/><br/><span class="hl-6">controller</span><span class="hl-2">.</span><span class="hl-4">abort</span><span class="hl-2">();</span>
</code></pre>
</div>
<h4 class="tsd-returns-title">Returns <a href="../types/index.WretchAddon.html" class="tsd-signature-type" data-tsd-kind="Type alias">WretchAddon</a><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/addons_abort.AbortWretch.html" class="tsd-signature-type" data-tsd-kind="Interface">AbortWretch</a><span class="tsd-signature-symbol">, </span><a href="../interfaces/addons_abort.AbortResolver.html" class="tsd-signature-type" data-tsd-kind="Interface">AbortResolver</a><span class="tsd-signature-symbol">&gt;</span></h4></li></ul></section></div>
<h4 class="tsd-returns-title">Returns <a href="../types/index.WretchAddon.html" class="tsd-signature-type" data-tsd-kind="Type alias">WretchAddon</a><span class="tsd-signature-symbol">&lt;</span><a href="../interfaces/addons_abort.AbortWretch.html" class="tsd-signature-type" data-tsd-kind="Interface">AbortWretch</a><span class="tsd-signature-symbol">, </span><a href="../interfaces/addons_abort.AbortResolver.html" class="tsd-signature-type" data-tsd-kind="Interface">AbortResolver</a><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/elbywan/wretch/blob/b6a1258/src/addons/abort.ts#L110">addons/abort.ts:110</a></li></ul></aside></li></ul></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
Expand Down
4 changes: 3 additions & 1 deletion docs/api/functions/addons_perfs.default.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ <h1>Function default</h1></div>
<pre><code class="language-js"><span class="hl-0">// Node.js only</span><br/><span class="hl-1">const</span><span class="hl-2"> { </span><span class="hl-3">performance</span><span class="hl-2">, </span><span class="hl-3">PerformanceObserver</span><span class="hl-2"> } = </span><span class="hl-4">require</span><span class="hl-2">(</span><span class="hl-5">&quot;perf_hooks&quot;</span><span class="hl-2">);</span><br/><br/><span class="hl-6">wretch</span><span class="hl-2">.</span><span class="hl-4">polyfills</span><span class="hl-2">({</span><br/><span class="hl-2"> </span><span class="hl-4">fetch</span><span class="hl-6">:</span><span class="hl-2"> </span><span class="hl-1">function</span><span class="hl-2"> (</span><span class="hl-6">url</span><span class="hl-2">, </span><span class="hl-6">opts</span><span class="hl-2">) {</span><br/><span class="hl-2"> </span><span class="hl-6">performance</span><span class="hl-2">.</span><span class="hl-4">mark</span><span class="hl-2">(</span><span class="hl-6">url</span><span class="hl-2"> + </span><span class="hl-5">&quot; - begin&quot;</span><span class="hl-2">);</span><br/><span class="hl-2"> </span><span class="hl-8">return</span><span class="hl-2"> </span><span class="hl-4">fetch</span><span class="hl-2">(</span><span class="hl-6">url</span><span class="hl-2">, </span><span class="hl-6">opts</span><span class="hl-2">).</span><span class="hl-4">then</span><span class="hl-2">(</span><span class="hl-6">res</span><span class="hl-2"> </span><span class="hl-1">=&gt;</span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-6">performance</span><span class="hl-2">.</span><span class="hl-4">mark</span><span class="hl-2">(</span><span class="hl-6">url</span><span class="hl-2"> + </span><span class="hl-5">&quot; - end&quot;</span><span class="hl-2">);</span><br/><span class="hl-2"> </span><span class="hl-4">setTimeout</span><span class="hl-2">(() </span><span class="hl-1">=&gt;</span><span class="hl-2"> </span><span class="hl-6">performance</span><span class="hl-2">.</span><span class="hl-4">measure</span><span class="hl-2">(</span><span class="hl-6">res</span><span class="hl-2">.</span><span class="hl-6">url</span><span class="hl-2">, </span><span class="hl-6">url</span><span class="hl-2"> + </span><span class="hl-5">&quot; - begin&quot;</span><span class="hl-2">, </span><span class="hl-6">url</span><span class="hl-2"> + </span><span class="hl-5">&quot; - end&quot;</span><span class="hl-2">), </span><span class="hl-7">0</span><span class="hl-2">);</span><br/><span class="hl-2"> </span><span class="hl-8">return</span><span class="hl-2"> </span><span class="hl-6">res</span><span class="hl-2">;</span><br/><span class="hl-2"> });</span><br/><span class="hl-2"> },</span><br/><span class="hl-2"> </span><span class="hl-0">// other polyfills…</span><br/><span class="hl-2"> </span><span class="hl-6">performance:</span><span class="hl-2"> </span><span class="hl-6">performance</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-6">PerformanceObserver:</span><span class="hl-2"> </span><span class="hl-6">PerformanceObserver</span><span class="hl-2">,</span><br/><span class="hl-2">});</span>
</code></pre>
</div>
<h4 class="tsd-returns-title">Returns <a href="../types/index.WretchAddon.html" class="tsd-signature-type" data-tsd-kind="Type alias">WretchAddon</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">, </span><a href="../interfaces/addons_perfs.PerfsAddon.html" class="tsd-signature-type" data-tsd-kind="Interface">PerfsAddon</a><span class="tsd-signature-symbol">&gt;</span></h4></li></ul></section></div>
<h4 class="tsd-returns-title">Returns <a href="../types/index.WretchAddon.html" class="tsd-signature-type" data-tsd-kind="Type alias">WretchAddon</a><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">, </span><a href="../interfaces/addons_perfs.PerfsAddon.html" class="tsd-signature-type" data-tsd-kind="Interface">PerfsAddon</a><span class="tsd-signature-symbol">&gt;</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/elbywan/wretch/blob/b6a1258/src/addons/perfs.ts#L114">addons/perfs.ts:114</a></li></ul></aside></li></ul></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
Expand Down
4 changes: 3 additions & 1 deletion docs/api/functions/index.default-1.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ <h5>_options: <span class="tsd-signature-symbol">{}</span><span class="tsd-signa
<div class="tsd-comment tsd-typography"><p>The base fetch options</p>
</div>
<ul class="tsd-parameters"></ul></li></ul></div>
<h4 class="tsd-returns-title">Returns <a href="../interfaces/index.Wretch.html" class="tsd-signature-type" data-tsd-kind="Interface">Wretch</a></h4></li></ul></section></div>
<h4 class="tsd-returns-title">Returns <a href="../interfaces/index.Wretch.html" class="tsd-signature-type" data-tsd-kind="Interface">Wretch</a></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/elbywan/wretch/blob/b6a1258/src/index.ts#L35">index.ts:35</a></li></ul></aside></li></ul></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
Expand Down
4 changes: 3 additions & 1 deletion docs/api/functions/middlewares_dedupe.dedupe.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><code class="tsd-tag ts-flagOptional">Optional</code> options: <a href="../types/middlewares_dedupe.DedupeOptions.html" class="tsd-signature-type" data-tsd-kind="Type alias">DedupeOptions</a></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <a href="../types/index.ConfiguredMiddleware.html" class="tsd-signature-type" data-tsd-kind="Type alias">ConfiguredMiddleware</a></h4></li></ul></section></div>
<h4 class="tsd-returns-title">Returns <a href="../types/index.ConfiguredMiddleware.html" class="tsd-signature-type" data-tsd-kind="Type alias">ConfiguredMiddleware</a></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/elbywan/wretch/blob/b6a1258/src/middlewares/dedupe.ts#L33">middlewares/dedupe.ts:33</a></li></ul></aside></li></ul></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
Expand Down
4 changes: 3 additions & 1 deletion docs/api/functions/middlewares_delay.delay.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5>time: <span class="tsd-signature-type">number</span></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <a href="../types/index.ConfiguredMiddleware.html" class="tsd-signature-type" data-tsd-kind="Type alias">ConfiguredMiddleware</a></h4></li></ul></section></div>
<h4 class="tsd-returns-title">Returns <a href="../types/index.ConfiguredMiddleware.html" class="tsd-signature-type" data-tsd-kind="Type alias">ConfiguredMiddleware</a></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/elbywan/wretch/blob/b6a1258/src/middlewares/delay.ts#L16">middlewares/delay.ts:16</a></li></ul></aside></li></ul></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
Expand Down
4 changes: 3 additions & 1 deletion docs/api/functions/middlewares_retry.retry.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><code class="tsd-tag ts-flagOptional">Optional</code> options: <a href="../types/middlewares_retry.RetryOptions.html" class="tsd-signature-type" data-tsd-kind="Type alias">RetryOptions</a></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <a href="../types/index.ConfiguredMiddleware.html" class="tsd-signature-type" data-tsd-kind="Type alias">ConfiguredMiddleware</a></h4></li></ul></section></div>
<h4 class="tsd-returns-title">Returns <a href="../types/index.ConfiguredMiddleware.html" class="tsd-signature-type" data-tsd-kind="Type alias">ConfiguredMiddleware</a></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/elbywan/wretch/blob/b6a1258/src/middlewares/retry.ts#L66">middlewares/retry.ts:66</a></li></ul></aside></li></ul></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ <h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><code class="tsd-tag ts-flagOptional">Optional</code> options: <a href="../types/middlewares_throttlingCache.ThrottlingCacheOptions.html" class="tsd-signature-type" data-tsd-kind="Type alias">ThrottlingCacheOptions</a></h5></li></ul></div>
<h4 class="tsd-returns-title">Returns <a href="../types/index.ConfiguredMiddleware.html" class="tsd-signature-type" data-tsd-kind="Type alias">ConfiguredMiddleware</a><span class="tsd-signature-symbol"> &amp; </span><span class="tsd-signature-symbol">{ </span>cache<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">; </span>inflight<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">; </span>throttling<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Set</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">; </span>cacheResponse<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> }</span></h4></li></ul></section></div>
<h4 class="tsd-returns-title">Returns <a href="../types/index.ConfiguredMiddleware.html" class="tsd-signature-type" data-tsd-kind="Type alias">ConfiguredMiddleware</a><span class="tsd-signature-symbol"> &amp; </span><span class="tsd-signature-symbol">{ </span>cache<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">; </span>inflight<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">; </span>throttling<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Set</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">unknown</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">; </span>cacheResponse<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> }</span></h4><aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/elbywan/wretch/blob/b6a1258/src/middlewares/throttlingCache.ts#L56">middlewares/throttlingCache.ts:56</a></li></ul></aside></li></ul></section></div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<div class="tsd-navigation settings">
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
Expand Down
Loading

0 comments on commit 4c4838d

Please sign in to comment.