@miniflare/storage-memory
Advanced tools
Comparing version 2.11.0 to 2.12.0
@@ -45,3 +45,3 @@ import { Awaitable } from '@miniflare/shared'; | ||
getMaybeExpired<Meta>(key: string): StoredValueMeta<Meta> | undefined; | ||
getRangeMaybeExpired<Meta>(key: string, { offset, length, suffix }: Range): RangeStoredValueMeta<Meta> | undefined; | ||
getRangeMaybeExpired<Meta>(key: string, range: Range): RangeStoredValueMeta<Meta> | undefined; | ||
put<Meta = unknown>(key: string, value: StoredValueMeta<Meta>): void; | ||
@@ -48,0 +48,0 @@ deleteMaybeExpired(key: string): boolean; |
@@ -40,3 +40,3 @@ var __create = Object.create; | ||
function listFilterMatch(options, name) { | ||
return !(options?.prefix && !name.startsWith(options.prefix) || options?.start && (0, import_shared.lexicographicCompare)(name, options.start) < 0 || options?.end && (0, import_shared.lexicographicCompare)(name, options.end) >= 0); | ||
return !(options?.prefix !== void 0 && !name.startsWith(options.prefix) || options?.excludePrefix !== void 0 && name.startsWith(options.excludePrefix) || options?.start !== void 0 && (0, import_shared.lexicographicCompare)(name, options.start) < 0 || options?.end !== void 0 && (0, import_shared.lexicographicCompare)(name, options.end) >= 0); | ||
} | ||
@@ -199,3 +199,3 @@ function listPaginate(options, keys) { | ||
} | ||
getRangeMaybeExpired(key, { offset, length, suffix }) { | ||
getRangeMaybeExpired(key, range) { | ||
const stored = this.map.get(key); | ||
@@ -206,23 +206,3 @@ if (stored === void 0) | ||
const size = value.byteLength; | ||
if (suffix !== void 0) { | ||
if (suffix <= 0) { | ||
throw new Error("Suffix must be > 0"); | ||
} | ||
if (suffix > size) | ||
suffix = size; | ||
offset = size - suffix; | ||
length = size - offset; | ||
} | ||
if (offset === void 0) | ||
offset = 0; | ||
if (length === void 0) | ||
length = size - offset; | ||
if (offset < 0) | ||
throw new Error("Offset must be >= 0"); | ||
if (offset > size) | ||
throw new Error("Offset must be < size"); | ||
if (length <= 0) | ||
throw new Error("Length must be > 0"); | ||
if (offset + length > size) | ||
length = size - offset; | ||
const { offset, length } = (0, import_shared3.parseRange)(range, size); | ||
return { | ||
@@ -229,0 +209,0 @@ value: value.slice(offset, offset + length), |
{ | ||
"name": "@miniflare/storage-memory", | ||
"version": "2.11.0", | ||
"version": "2.12.0", | ||
"description": "In-memory storage module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers", | ||
@@ -38,7 +38,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@miniflare/shared": "2.11.0" | ||
"@miniflare/shared": "2.12.0" | ||
}, | ||
"devDependencies": { | ||
"@miniflare/shared-test": "2.11.0" | ||
"@miniflare/shared-test": "2.12.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
16636
294
+ Added@miniflare/shared@2.12.0(transitive)
- Removed@miniflare/shared@2.11.0(transitive)
Updated@miniflare/shared@2.12.0