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

@miniflare/durable-objects

Package Overview
Dependencies
Maintainers
2
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@miniflare/durable-objects - npm Package Compare versions

Comparing version 2.12.0 to 2.12.1

29

dist/src/index.js

@@ -1011,2 +1011,4 @@ var __create = Object.create;

}
var STORAGE_PREFIX = "durable-objects:storage:";
var STATE_PREFIX = "durable-objects:state:";
var DurableObjectsPlugin = class extends import_shared5.Plugin {

@@ -1023,4 +1025,3 @@ durableObjects;

#bindings = {};
#objectStorages = new Map();
#objectStates = new Map();
#sharedCache;
#alarmStore;

@@ -1033,2 +1034,3 @@ #alarmStoreCallback;

this.#persist = (0, import_shared5.resolveStoragePersist)(ctx.rootPath, this.durableObjectsPersist);
this.#sharedCache = ctx.sharedCache;
this.#alarmStore = new AlarmStore();

@@ -1044,7 +1046,8 @@ this.#processedObjects = Object.entries(this.durableObjects ?? {}).map(([name, options2]) => {

const key = getObjectKeyFromId(id);
let objectStorage = this.#objectStorages.get(key);
const cacheKey = `${STORAGE_PREFIX}${key}`;
let objectStorage = this.#sharedCache.get(cacheKey);
if (objectStorage !== void 0)
return objectStorage;
objectStorage = new DurableObjectStorage(storage.storage(key, this.#persist), this.#alarmStore.buildBridge(key));
this.#objectStorages.set(key, objectStorage);
this.#sharedCache.set(cacheKey, objectStorage);
return objectStorage;

@@ -1056,3 +1059,4 @@ }

const key = getObjectKeyFromId(id);
let state = this.#objectStates.get(key);
const cacheKey = `${STATE_PREFIX}${key}`;
let state = this.#sharedCache.get(cacheKey);
if (state !== void 0)

@@ -1064,3 +1068,3 @@ return state;

state = new DurableObjectState(unnamedId, objectStorage);
this.#objectStates.set(key, state);
this.#sharedCache.set(cacheKey, state);
const constructor = this.#constructors.get(objectName);

@@ -1114,7 +1118,14 @@ (0, import_assert4.default)(constructor);

getObjects(storageFactory, namespace) {
return [...this.#objectStates.keys()].map(getObjectIdFromKey).filter((id) => id[kObjectName] === namespace);
const ids = [];
for (const cacheKey of this.#sharedCache.keys()) {
if (cacheKey.startsWith(STATE_PREFIX)) {
const key = cacheKey.substring(STATE_PREFIX.length);
const id = getObjectIdFromKey(key);
if (id[kObjectName] === namespace)
ids.push(id);
}
}
return ids;
}
async beforeReload() {
this.#objectStorages.clear();
this.#objectStates.clear();
this.#contextPromise = new Promise((resolve) => this.#contextResolve = resolve);

@@ -1121,0 +1132,0 @@ if (!this.#alarmStoreCallbackAttached && this.#alarmStoreCallback !== void 0) {

{
"name": "@miniflare/durable-objects",
"version": "2.12.0",
"version": "2.12.1",
"description": "Durable Objects module for Miniflare: a fun, full-featured, fully-local simulator for Cloudflare Workers",

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

"dependencies": {
"@miniflare/core": "2.12.0",
"@miniflare/shared": "2.12.0",
"@miniflare/storage-memory": "2.12.0",
"undici": "5.11.0"
"@miniflare/core": "2.12.1",
"@miniflare/shared": "2.12.1",
"@miniflare/storage-memory": "2.12.1",
"undici": "5.20.0"
},
"devDependencies": {
"@miniflare/cache": "2.12.0",
"@miniflare/runner-vm": "2.12.0",
"@miniflare/shared-test": "2.12.0"
"@miniflare/cache": "2.12.1",
"@miniflare/runner-vm": "2.12.1",
"@miniflare/shared-test": "2.12.1"
}
}

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