@sveltejs/adapter-cloudflare
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -5,16 +5,18 @@ // src/worker.js | ||
// ../../node_modules/.pnpm/worktop@0.8.0-next.14/node_modules/worktop/cache/index.mjs | ||
// ../../node_modules/.pnpm/worktop@0.8.0-next.15/node_modules/worktop/cache/index.mjs | ||
async function e(e3, t2) { | ||
let n2 = "string" != typeof t2 && "HEAD" === t2.method; | ||
n2 && (t2 = new Request(t2, { method: "GET" })); | ||
let a2 = await e3.match(t2); | ||
return n2 && a2 && (a2 = new Response(null, a2)), a2; | ||
let r3 = await e3.match(t2); | ||
return n2 && r3 && (r3 = new Response(null, r3)), r3; | ||
} | ||
function t(e3, t2, n2, o2) { | ||
return ("string" == typeof t2 || "GET" === t2.method) && a(n2) && (n2.headers.has("Set-Cookie") && (n2 = new Response(n2.body, n2)).headers.append("Cache-Control", "private=Set-Cookie"), o2.waitUntil(e3.put(t2, n2.clone()))), n2; | ||
return ("string" == typeof t2 || "GET" === t2.method) && r(n2) && (n2.headers.has("Set-Cookie") && (n2 = new Response(n2.body, n2)).headers.append("Cache-Control", "private=Set-Cookie"), o2.waitUntil(e3.put(t2, n2.clone()))), n2; | ||
} | ||
var n = /* @__PURE__ */ new Set([200, 203, 204, 300, 301, 404, 405, 410, 414, 501]); | ||
function a(e3) { | ||
if (!n.has(e3.status) || ~(e3.headers.get("Vary") || "").indexOf("*")) | ||
function r(e3) { | ||
if (!n.has(e3.status)) | ||
return false; | ||
if (~(e3.headers.get("Vary") || "").indexOf("*")) | ||
return false; | ||
let t2 = e3.headers.get("Cache-Control") || ""; | ||
@@ -24,8 +26,8 @@ return !/(private|no-cache|no-store)/i.test(t2); | ||
function o(n2) { | ||
return async function(a2, o2) { | ||
let r2 = await e(n2, a2); | ||
if (r2) | ||
return r2; | ||
return async function(r3, o2) { | ||
let a = await e(n2, r3); | ||
if (a) | ||
return a; | ||
o2.defer((e3) => { | ||
t(n2, a2, e3, o2); | ||
t(n2, r3, e3, o2); | ||
}); | ||
@@ -35,7 +37,7 @@ }; | ||
// ../../node_modules/.pnpm/worktop@0.8.0-next.14/node_modules/worktop/cfw.cache/index.mjs | ||
// ../../node_modules/.pnpm/worktop@0.8.0-next.15/node_modules/worktop/cfw.cache/index.mjs | ||
var s = caches.default; | ||
var e2 = t.bind(0, s); | ||
var c = e.bind(0, s); | ||
var r = o.bind(0, s); | ||
var c = t.bind(0, s); | ||
var r2 = e.bind(0, s); | ||
var e2 = o.bind(0, s); | ||
@@ -48,3 +50,3 @@ // src/worker.js | ||
let pragma = req.headers.get("cache-control") || ""; | ||
let res = !pragma.includes("no-cache") && await c(req); | ||
let res = !pragma.includes("no-cache") && await r2(req); | ||
if (res) | ||
@@ -75,2 +77,3 @@ return res; | ||
res = await server.respond(req, { | ||
// @ts-ignore | ||
platform: { env, context, caches }, | ||
@@ -83,3 +86,3 @@ getClientAddress() { | ||
pragma = res.headers.get("cache-control"); | ||
return pragma && res.ok ? e2(req, res, context) : res; | ||
return pragma && res.ok ? c(req, res, context) : res; | ||
} | ||
@@ -86,0 +89,0 @@ }; |
{ | ||
"name": "@sveltejs/adapter-cloudflare", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Adapter for building SvelteKit applications on Cloudflare Pages with Workers integration", | ||
"repository": { | ||
@@ -27,5 +28,5 @@ "type": "git", | ||
"dependencies": { | ||
"@cloudflare/workers-types": "^4.20221111.1", | ||
"esbuild": "^0.16.3", | ||
"worktop": "0.8.0-next.14" | ||
"@cloudflare/workers-types": "^4.20230404.0", | ||
"esbuild": "^0.17.18", | ||
"worktop": "0.8.0-next.15" | ||
}, | ||
@@ -32,0 +33,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11131
253
+ Added@esbuild/android-arm@0.17.19(transitive)
+ Added@esbuild/android-arm64@0.17.19(transitive)
+ Added@esbuild/android-x64@0.17.19(transitive)
+ Added@esbuild/darwin-arm64@0.17.19(transitive)
+ Added@esbuild/darwin-x64@0.17.19(transitive)
+ Added@esbuild/freebsd-arm64@0.17.19(transitive)
+ Added@esbuild/freebsd-x64@0.17.19(transitive)
+ Added@esbuild/linux-arm@0.17.19(transitive)
+ Added@esbuild/linux-arm64@0.17.19(transitive)
+ Added@esbuild/linux-ia32@0.17.19(transitive)
+ Added@esbuild/linux-loong64@0.17.19(transitive)
+ Added@esbuild/linux-mips64el@0.17.19(transitive)
+ Added@esbuild/linux-ppc64@0.17.19(transitive)
+ Added@esbuild/linux-riscv64@0.17.19(transitive)
+ Added@esbuild/linux-s390x@0.17.19(transitive)
+ Added@esbuild/linux-x64@0.17.19(transitive)
+ Added@esbuild/netbsd-x64@0.17.19(transitive)
+ Added@esbuild/openbsd-x64@0.17.19(transitive)
+ Added@esbuild/sunos-x64@0.17.19(transitive)
+ Added@esbuild/win32-arm64@0.17.19(transitive)
+ Added@esbuild/win32-ia32@0.17.19(transitive)
+ Added@esbuild/win32-x64@0.17.19(transitive)
+ Addedesbuild@0.17.19(transitive)
+ Addedworktop@0.8.0-next.15(transitive)
- Removed@esbuild/android-arm@0.16.17(transitive)
- Removed@esbuild/android-arm64@0.16.17(transitive)
- Removed@esbuild/android-x64@0.16.17(transitive)
- Removed@esbuild/darwin-arm64@0.16.17(transitive)
- Removed@esbuild/darwin-x64@0.16.17(transitive)
- Removed@esbuild/freebsd-arm64@0.16.17(transitive)
- Removed@esbuild/freebsd-x64@0.16.17(transitive)
- Removed@esbuild/linux-arm@0.16.17(transitive)
- Removed@esbuild/linux-arm64@0.16.17(transitive)
- Removed@esbuild/linux-ia32@0.16.17(transitive)
- Removed@esbuild/linux-loong64@0.16.17(transitive)
- Removed@esbuild/linux-mips64el@0.16.17(transitive)
- Removed@esbuild/linux-ppc64@0.16.17(transitive)
- Removed@esbuild/linux-riscv64@0.16.17(transitive)
- Removed@esbuild/linux-s390x@0.16.17(transitive)
- Removed@esbuild/linux-x64@0.16.17(transitive)
- Removed@esbuild/netbsd-x64@0.16.17(transitive)
- Removed@esbuild/openbsd-x64@0.16.17(transitive)
- Removed@esbuild/sunos-x64@0.16.17(transitive)
- Removed@esbuild/win32-arm64@0.16.17(transitive)
- Removed@esbuild/win32-ia32@0.16.17(transitive)
- Removed@esbuild/win32-x64@0.16.17(transitive)
- Removedesbuild@0.16.17(transitive)
- Removedworktop@0.8.0-next.14(transitive)
Updatedesbuild@^0.17.18
Updatedworktop@0.8.0-next.15