Bump pako from 1.0.11 to 2.0.2 in /desktop (#1786)

Summary:
Bumps [pako](https://github.com/nodeca/pako) from 1.0.11 to 2.0.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/nodeca/pako/blob/master/CHANGELOG.md">pako's changelog</a>.</em></p>
<blockquote>
<h2>[2.0.2] - 2020-11-19</h2>
<h3>Fixed</h3>
<ul>
<li>Fix esm build named exports.</li>
</ul>
<h2>[2.0.1] - 2020-11-17</h2>
<h3>Changed</h3>
<ul>
<li>Changed esm build <code>.js</code> =&gt; <code>.mjs</code> to fix node.js <code>import</code>.</li>
<li>Added <code>module</code> entry in package.json for some bundlers.</li>
</ul>
<h2>[2.0.0] - 2020-11-17</h2>
<h3>Changed</h3>
<ul>
<li>Removed binary strings and <code>Array</code> support.</li>
<li>Removed fallbacks for TypedArray methods (<code>.set()</code>, <code>.subarray()</code>).</li>
<li>Rewritten top-level wrappers.</li>
<li>Removed support of <code>Inflate</code> &amp; <code>Deflate</code> instance create without <code>new</code>.</li>
<li><code>Inflate.push()</code> no longer needs second param (end is auto-detected).</li>
<li>Increased default inflate chunk size to 64K.</li>
<li>Moved exported constants to <code>.constants</code>.</li>
<li>Switched to es6. Legacy es5 builds available in <code>/dist</code>.</li>
<li>Added esm build.</li>
<li>Structure of <code>/dist</code> folder changed.</li>
<li>Upgraded build tools to modern ones.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="45cce9f4d6"><code>45cce9f</code></a> 2.0.2 released</li>
<li><a href="b3861d9a66"><code>b3861d9</code></a> dist rebuild</li>
<li><a href="d0382badcc"><code>d0382ba</code></a> Fix esm build named exports</li>
<li><a href="8d5f9c70f8"><code>8d5f9c7</code></a> 2.0.1 released</li>
<li><a href="70ee7697ac"><code>70ee769</code></a> dist rebuild</li>
<li><a href="bd90fca738"><code>bd90fca</code></a> Add <code>module</code> entry for some bundlers</li>
<li><a href="84d6931fe8"><code>84d6931</code></a> Rename module build .js =&gt; .mjs to fix node import (<a href="https://github-redirect.dependabot.com/nodeca/pako/issues/200">https://github.com/facebook/flipper/issues/200</a>)</li>
<li><a href="52df0c510f"><code>52df0c5</code></a> 2.0.0 released</li>
<li><a href="a8faeffc94"><code>a8faeff</code></a> dist rebuild</li>
<li><a href="b4d9a94488"><code>b4d9a94</code></a> Added esm build, <a href="https://github-redirect.dependabot.com/nodeca/pako/issues/97">https://github.com/facebook/flipper/issues/97</a></li>
<li>Additional commits viewable in <a href="https://github.com/nodeca/pako/compare/1.0.11...2.0.2">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pako&package-manager=npm_and_yarn&previous-version=1.0.11&new-version=2.0.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

Pull Request resolved: https://github.com/facebook/flipper/pull/1786

Reviewed By: passy

Differential Revision: D25664507

Pulled By: cekkaewnumchai

fbshipit-source-id: bd33a7a11ef38b54675cde31d1243742476263d9
This commit is contained in:
dependabot[bot]
2020-12-22 04:01:02 -08:00
committed by Facebook GitHub Bot
parent 985e620f6f
commit be6fd42e11
3 changed files with 13 additions and 3 deletions

View File

@@ -18,7 +18,7 @@
},
"dependencies": {
"lodash": "^4.17.19",
"pako": "^1.0.11",
"pako": "^2.0.2",
"xml-beautifier": "^0.4.0"
},
"peerDependencies": {

View File

@@ -30,9 +30,14 @@ export function decodeBody(container: Request | Response): string {
getHeaderValue(container.headers, 'Content-Encoding') === 'gzip';
if (isGzip) {
try {
const binStr = Base64.atob(container.data);
const dataArr = new Uint8Array(binStr.length);
for (let i = 0; i < binStr.length; i++) {
dataArr[i] = binStr.charCodeAt(i);
}
// The request is gzipped, so convert the base64 back to the raw bytes first,
// then inflate. pako will detect the BOM headers and return a proper utf-8 string right away
return pako.inflate(Base64.atob(container.data), {to: 'string'});
return pako.inflate(dataArr, {to: 'string'});
} catch (e) {
// on iOS, the stream send to flipper is already inflated, so the content-encoding will not
// match the actual data anymore, and we should skip inflating.

View File

@@ -9738,7 +9738,12 @@ paged-request@^2.0.1:
dependencies:
axios "^0.18.0"
pako@^1.0.11, pako@~1.0.2:
pako@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/pako/-/pako-2.0.2.tgz#8a72af7a93431ef22aa97e0d53b0acaa3c689220"
integrity sha512-9e8DRI3+dRLomCmMBAH30B2ejh+blwXr7VmMEx/pVFZlSDA7oyI8uKMhKXr8IrZpoxBF2YlxUvhqRXzTT1i0NA==
pako@~1.0.2:
version "1.0.11"
resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf"
integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==