Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@miniflare/kv

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@miniflare/kv - npm Package Compare versions

Comparing version 2.0.0-rc.4 to 2.0.0-rc.5

9

dist/src/index.d.ts

@@ -10,2 +10,7 @@ import { Clock } from '@miniflare/shared';

export declare interface InternalKVNamespaceOptions {
clock?: Clock;
blockGlobalAsyncIO?: boolean;
}
export declare type KVGetOptions<Type extends KVGetValueType = KVGetValueType> = {

@@ -32,3 +37,3 @@ type: Type;

#private;
constructor(storage: Storage, clock?: Clock);
constructor(storage: Storage, { clock, blockGlobalAsyncIO, }?: InternalKVNamespaceOptions);
get(key: string, options?: "text" | Partial<KVGetOptions<"text">>): KVValue<string>;

@@ -57,3 +62,3 @@ get<Value = unknown>(key: string, options: "json" | KVGetOptions<"json">): KVValue<Value>;

constructor(ctx: PluginContext, options?: KVOptions);
getNamespace(storage: StorageFactory, namespace: string): Promise<KVNamespace>;
getNamespace(storage: StorageFactory, namespace: string, blockGlobalAsyncIO?: boolean): Promise<KVNamespace>;
setup(storageFactory: StorageFactory): Promise<SetupResult>;

@@ -60,0 +65,0 @@ }

@@ -111,7 +111,14 @@ var __create = Object.create;

#clock;
constructor(storage, clock = import_shared.defaultClock) {
#blockGlobalAsyncIO;
constructor(storage, {
clock = import_shared.defaultClock,
blockGlobalAsyncIO = false
} = {}) {
this.#storage = storage;
this.#clock = clock;
this.#blockGlobalAsyncIO = blockGlobalAsyncIO;
}
async get(key, options) {
if (this.#blockGlobalAsyncIO)
(0, import_shared.assertInRequest)();
if (typeof key !== "string") {

@@ -129,2 +136,4 @@ throw new TypeError("Failed to execute 'get'" + keyTypeError);

async getWithMetadata(key, options) {
if (this.#blockGlobalAsyncIO)
(0, import_shared.assertInRequest)();
if (typeof key !== "string") {

@@ -143,2 +152,4 @@ throw new TypeError("Failed to execute 'getWithMetadata'" + keyTypeError);

async put(key, value, options = {}) {
if (this.#blockGlobalAsyncIO)
(0, import_shared.assertInRequest)();
if (typeof key !== "string") {

@@ -195,2 +206,4 @@ throw new TypeError("Failed to execute 'put'" + keyTypeError);

async delete(key) {
if (this.#blockGlobalAsyncIO)
(0, import_shared.assertInRequest)();
if (typeof key !== "string") {

@@ -209,2 +222,4 @@ throw new TypeError("Failed to execute 'delete'" + keyTypeError);

} = {}) {
if (this.#blockGlobalAsyncIO)
(0, import_shared.assertInRequest)();
if (isNaN(limit) || limit < 1) {

@@ -237,9 +252,12 @@ throwKVError("GET", 400, `Invalid key_count_limit of ${limit}. Please specify an integer greater than 0.`);

}
async getNamespace(storage, namespace) {
return new KVNamespace(await storage.storage(namespace, this.#persist));
async getNamespace(storage, namespace, blockGlobalAsyncIO = false) {
return new KVNamespace(await storage.storage(namespace, this.#persist), {
blockGlobalAsyncIO
});
}
async setup(storageFactory) {
const blockGlobalAsyncIO = !this.ctx.globalAsyncIO;
const bindings = {};
for (const namespace of this.kvNamespaces ?? []) {
bindings[namespace] = await this.getNamespace(storageFactory, namespace);
bindings[namespace] = await this.getNamespace(storageFactory, namespace, blockGlobalAsyncIO);
}

@@ -246,0 +264,0 @@ return { bindings };

{
"name": "@miniflare/kv",
"version": "2.0.0-rc.4",
"version": "2.0.0-rc.5",
"description": "Workers KV module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers",

@@ -38,7 +38,7 @@ "keywords": [

"dependencies": {
"@miniflare/shared": "2.0.0-rc.4"
"@miniflare/shared": "2.0.0-rc.5"
},
"devDependencies": {
"@miniflare/shared-test": "2.0.0-rc.4"
"@miniflare/shared-test": "2.0.0-rc.5"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc