@miniflare/r2
Advanced tools
Comparing version 2.10.0 to 2.11.0
@@ -137,8 +137,14 @@ var __create = Object.create; | ||
function parseHeaderArray(input) { | ||
if (typeof input !== "string") | ||
return; | ||
if (!input.includes(",")) | ||
return input; | ||
return input.split(",").map((x) => x.trim()); | ||
return stripQuotes(input); | ||
return input.split(",").map((x) => stripQuotes(x)); | ||
} | ||
function stripQuotes(input) { | ||
input = input.trim(); | ||
if (input[0] === '"') | ||
input = input.slice(1); | ||
if (input[input.length - 1] === '"') | ||
input = input.slice(0, -1); | ||
return input; | ||
} | ||
function parseOnlyIf(onlyIf) { | ||
@@ -157,11 +163,15 @@ if (onlyIf === void 0) | ||
onlyIf.etagMatches = parseHeaderArray(onlyIf.etagMatches); | ||
} else if (Array.isArray(onlyIf.etagMatches)) { | ||
onlyIf.etagMatches = onlyIf.etagMatches.map((x) => stripQuotes(x)); | ||
} | ||
if (typeof onlyIf.etagDoesNotMatch === "string") { | ||
onlyIf.etagDoesNotMatch = parseHeaderArray(onlyIf.etagDoesNotMatch); | ||
} else if (Array.isArray(onlyIf.etagDoesNotMatch)) { | ||
onlyIf.etagDoesNotMatch = onlyIf.etagDoesNotMatch.map((x) => stripQuotes(x)); | ||
} | ||
if (typeof onlyIf.uploadedBefore === "string") { | ||
onlyIf.uploadedBefore = new Date(onlyIf.uploadedBefore); | ||
onlyIf.uploadedBefore = new Date(stripQuotes(onlyIf.uploadedBefore)); | ||
} | ||
if (typeof onlyIf.uploadedAfter === "string") { | ||
onlyIf.uploadedAfter = new Date(onlyIf.uploadedAfter); | ||
onlyIf.uploadedAfter = new Date(stripQuotes(onlyIf.uploadedAfter)); | ||
} | ||
@@ -168,0 +178,0 @@ return onlyIf; |
{ | ||
"name": "@miniflare/r2", | ||
"version": "2.10.0", | ||
"version": "2.11.0", | ||
"description": "Workers R2 module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", | ||
@@ -38,8 +38,8 @@ "keywords": [ | ||
"dependencies": { | ||
"@miniflare/shared": "2.10.0", | ||
"@miniflare/shared": "2.11.0", | ||
"undici": "5.9.1" | ||
}, | ||
"devDependencies": { | ||
"@miniflare/shared-test": "2.10.0" | ||
"@miniflare/shared-test": "2.11.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
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
38783
749
+ Added@miniflare/shared@2.11.0(transitive)
- Removed@miniflare/shared@2.10.0(transitive)
Updated@miniflare/shared@2.11.0