@php-wasm/web 3.0.14 → 3.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -606,8 +606,8 @@ async function q(i, e, t, r) {
606
606
  const a = [];
607
607
  for (; B(a).byteLength < r; ) {
608
608
  _ = await Q(s, _);
609
- const S = B([_, n]), h = await Q(s, S);
610
- a.push(h);
609
+ const S = B([_, n]), A = await Q(s, S);
610
+ a.push(A);
611
611
  }
612
612
  return B(a).slice(0, r);
613
613
  }
@@ -649,7 +649,7 @@ const ve = {
649
649
  UserCanceled: 90,
650
650
  NoRenegotiation: 100,
651
651
  UnsupportedExtension: 110
652
- }, he = f(Ne), C = {
652
+ }, Ae = f(Ne), C = {
653
653
  ChangeCipherSpec: 20,
654
654
  Alert: 21,
655
655
  Handshake: 22,
@@ -846,7 +846,7 @@ class Oe {
846
846
  u([t, e]),
847
847
  // Client key, server key, client IV, server IV
848
848
  40
849
- ), c = new y(a), S = c.readUint8Array(16), h = c.readUint8Array(16), A = c.readUint8Array(4), l = c.readUint8Array(4);
849
+ ), c = new y(a), S = c.readUint8Array(16), A = c.readUint8Array(16), h = c.readUint8Array(4), l = c.readUint8Array(4);
850
850
  return {
851
851
  masterSecret: _,
852
852
  clientWriteKey: await crypto.subtle.importKey(
@@ -858,12 +858,12 @@ class Oe {
858
858
  ),
859
859
  serverWriteKey: await crypto.subtle.importKey(
860
860
  "raw",
861
- h,
861
+ A,
862
862
  { name: "AES-GCM" },
863
863
  !1,
864
864
  ["encrypt", "decrypt"]
865
865
  ),
866
- clientIV: A,
866
+ clientIV: h,
867
867
  serverIV: l
868
868
  };
869
869
  }
@@ -903,7 +903,7 @@ class Oe {
903
903
  fragment: this.sessionKeys && n !== C.ChangeCipherSpec ? await this.decryptData(n, s) : s
904
904
  };
905
905
  if (_.type === C.Alert) {
906
- const a = Ce[_.fragment[0]], c = he[_.fragment[1]];
906
+ const a = Ce[_.fragment[0]], c = Ae[_.fragment[1]];
907
907
  throw new Error(
908
908
  `TLS non-warning alert received: ${a} ${c}`
909
909
  );
@@ -1105,7 +1105,7 @@ class E {
1105
1105
  return {
1106
1106
  type: C.Alert,
1107
1107
  level: Ce[e[0]],
1108
- description: he[e[1]]
1108
+ description: Ae[e[1]]
1109
1109
  };
1110
1110
  }
1111
1111
  static clientHandshake(e) {
@@ -1300,7 +1300,7 @@ class g {
1300
1300
  ), c = new Uint8Array(a), S = new Uint8Array([
1301
1301
  j.sha256,
1302
1302
  F.rsa
1303
- ]), h = new Uint8Array([
1303
+ ]), A = new Uint8Array([
1304
1304
  ..._,
1305
1305
  ...S,
1306
1306
  ...K(c.length),
@@ -1308,8 +1308,8 @@ class g {
1308
1308
  ]);
1309
1309
  return new Uint8Array([
1310
1310
  T.ServerKeyExchange,
1311
- ...w(h.length),
1312
- ...h
1311
+ ...w(A.length),
1312
+ ...A
1313
1313
  ]);
1314
1314
  }
1315
1315
  /**
@@ -1424,7 +1424,7 @@ function je(i, e) {
1424
1424
  function Ht(i) {
1425
1425
  return `-----BEGIN CERTIFICATE-----
1426
1426
  ${le(
1427
- Ae(i.buffer)
1427
+ he(i.buffer)
1428
1428
  )}
1429
1429
  -----END CERTIFICATE-----`;
1430
1430
  }
@@ -1432,7 +1432,7 @@ async function dt(i) {
1432
1432
  const e = await crypto.subtle.exportKey("pkcs8", i);
1433
1433
  return `-----BEGIN PRIVATE KEY-----
1434
1434
  ${le(
1435
- Ae(e)
1435
+ he(e)
1436
1436
  )}
1437
1437
  -----END PRIVATE KEY-----`;
1438
1438
  }
@@ -1819,7 +1819,7 @@ class o {
1819
1819
  );
1820
1820
  }
1821
1821
  }
1822
- function Ae(i) {
1822
+ function he(i) {
1823
1823
  return btoa(String.fromCodePoint(...new Uint8Array(i)));
1824
1824
  }
1825
1825
  function le(i) {
@@ -1853,7 +1853,7 @@ async function ze(i, e, t, r) {
1853
1853
  try {
1854
1854
  return await fetch(a);
1855
1855
  } catch {
1856
- const A = ((S = new Headers(c.headers).get("x-cors-proxy-allowed-request-headers")) == null ? void 0 : S.split(",")) || [], l = A.includes("authorization") || A.includes("cookie"), H = await ge(c, {
1856
+ const h = ((S = new Headers(c.headers).get("x-cors-proxy-allowed-request-headers")) == null ? void 0 : S.split(",")) || [], l = h.includes("authorization") || h.includes("cookie"), H = await ge(c, {
1857
1857
  url: `${t}${n.url}`,
1858
1858
  ...l && { credentials: "include" }
1859
1859
  });
@@ -2174,7 +2174,7 @@ Content-Length: 0\r
2174
2174
  );
2175
2175
  }
2176
2176
  a.releaseLock();
2177
- const c = n.slice(0, _), S = L.parseRequestHeaders(c), h = S.headers.get("Transfer-Encoding") !== null ? "chunked" : "content-length", A = S.headers.get("Content-Length") !== null ? parseInt(S.headers.get("Content-Length"), 10) : void 0, l = n.slice(
2177
+ const c = n.slice(0, _), S = L.parseRequestHeaders(c), A = S.headers.get("Transfer-Encoding") !== null ? "chunked" : "content-length", h = S.headers.get("Content-Length") !== null ? parseInt(S.headers.get("Content-Length"), 10) : void 0, l = n.slice(
2178
2178
  _ + 4
2179
2179
  /* Skip \r\n\r\n */
2180
2180
  );
@@ -2194,14 +2194,14 @@ Content-Length: 0\r
2194
2194
  if (R += (m == null ? void 0 : m.length) || 0, m && (I.enqueue(m), x = u([
2195
2195
  x,
2196
2196
  m || new Uint8Array()
2197
- ]).slice(-5)), de || h === "content-length" && A !== void 0 && R >= A || h === "chunked" && x.every(
2197
+ ]).slice(-5)), de || A === "content-length" && h !== void 0 && R >= h || A === "chunked" && x.every(
2198
2198
  (Te, Ee) => Te === He[Ee]
2199
2199
  )) {
2200
2200
  I.close();
2201
2201
  return;
2202
2202
  }
2203
2203
  }
2204
- }), h === "chunked" && (H = H.pipeThrough(
2204
+ }), A === "chunked" && (H = H.pipeThrough(
2205
2205
  new Ye()
2206
2206
  ));
2207
2207
  }
@@ -2343,20 +2343,20 @@ async function nt(i, e, t) {
2343
2343
  const [_, a] = s.pop();
2344
2344
  for await (const c of _.values()) {
2345
2345
  const S = r.run(async () => {
2346
- const h = ie(
2346
+ const A = ie(
2347
2347
  a,
2348
2348
  c.name
2349
2349
  );
2350
2350
  if (c.kind === "directory") {
2351
2351
  try {
2352
- i.mkdir(h);
2353
- } catch (A) {
2354
- if ((A == null ? void 0 : A.errno) !== 20)
2355
- throw U.error(A), A;
2352
+ i.mkdir(A);
2353
+ } catch (h) {
2354
+ if ((h == null ? void 0 : h.errno) !== 20)
2355
+ throw U.error(h), h;
2356
2356
  }
2357
- s.push([c, h]);
2357
+ s.push([c, A]);
2358
2358
  } else if (c.kind === "file") {
2359
- const A = await c.getFile(), l = new Uint8Array(await A.arrayBuffer());
2359
+ const h = await c.getFile(), l = new Uint8Array(await h.arrayBuffer());
2360
2360
  i.createDataFile(
2361
2361
  a,
2362
2362
  c.name,
@@ -2377,17 +2377,17 @@ async function nt(i, e, t) {
2377
2377
  async function ue(i, e, t, r) {
2378
2378
  i.mkdirTree(t);
2379
2379
  const n = [];
2380
- async function s(h, A) {
2380
+ async function s(A, h) {
2381
2381
  await Promise.all(
2382
- i.readdir(h).filter(
2382
+ i.readdir(A).filter(
2383
2383
  (l) => l !== "." && l !== ".."
2384
2384
  ).map(async (l) => {
2385
- const H = ie(h, l);
2385
+ const H = ie(A, l);
2386
2386
  if (!st(i, H)) {
2387
- n.push([A, H, l]);
2387
+ n.push([h, H, l]);
2388
2388
  return;
2389
2389
  }
2390
- const M = await A.getDirectoryHandle(l, {
2390
+ const M = await h.getDirectoryHandle(l, {
2391
2391
  create: !0
2392
2392
  });
2393
2393
  return await s(H, M);
@@ -2398,12 +2398,12 @@ async function ue(i, e, t, r) {
2398
2398
  let _ = 0;
2399
2399
  const a = r && ot(r, 100), c = 100, S = /* @__PURE__ */ new Set();
2400
2400
  try {
2401
- for (const [h, A, l] of n) {
2401
+ for (const [A, h, l] of n) {
2402
2402
  const H = O(
2403
- h,
2403
+ A,
2404
2404
  l,
2405
2405
  i,
2406
- A
2406
+ h
2407
2407
  ).then(() => {
2408
2408
  _++, S.delete(H), a == null || a({
2409
2409
  files: _,
@@ -2455,14 +2455,14 @@ function it(i, e, t) {
2455
2455
  r.splice(0, c.length);
2456
2456
  const S = Ie(c);
2457
2457
  try {
2458
- for (const h of S)
2459
- await s.processEntry(h);
2458
+ for (const A of S)
2459
+ await s.processEntry(A);
2460
2460
  } finally {
2461
2461
  a();
2462
2462
  }
2463
2463
  }
2464
- return i.addEventListener("request.end", _), function() {
2465
- n(), i.removeEventListener("request.end", _);
2464
+ return i.addEventListener("request.end", _), i.addEventListener("filesystem.write", _), function() {
2465
+ n(), i.removeEventListener("request.end", _), i.removeEventListener("filesystem.write", _);
2466
2466
  };
2467
2467
  }
2468
2468
  class _t {