miniflare
Advanced tools
Comparing version 3.20240405.1 to 3.20240405.2
@@ -608,3 +608,3 @@ // ../../node_modules/.pnpm/kleur@4.1.5/node_modules/kleur/colors.mjs | ||
let proto = Object.getPrototypeOf(value); | ||
return proto === Object.prototype || proto === null || Object.getOwnPropertyNames(proto).sort().join("\0") === objectProtoNames; | ||
return value?.constructor?.name === "RpcStub" ? !1 : proto === Object.prototype || proto === null || Object.getOwnPropertyNames(proto).sort().join("\0") === objectProtoNames; | ||
} | ||
@@ -630,3 +630,3 @@ function getType(value) { | ||
let address = this.nextHeapAddress++; | ||
return this.heap.set(address, value), assert2(typeof value == "object" && value !== null), [address, value.constructor.name]; | ||
return this.heap.set(address, value), assert2(value !== null), [address, value?.constructor.name]; | ||
} | ||
@@ -691,3 +691,3 @@ } | ||
if (opHeader === ProxyOps.GET) { | ||
if (result = keyHeader === null ? target : target[keyHeader], typeof result == "function") | ||
if (result = keyHeader === null ? target : target[keyHeader], result?.constructor.name === "RpcProperty" && (result = await result), typeof result == "function") | ||
return new Response(null, { | ||
@@ -737,3 +737,13 @@ status: 204, | ||
try { | ||
result = func.apply(target, args), isR2ObjectWriteHttpMetadata(targetName, keyHeader) && (result = args[0]); | ||
func.constructor.name === "RpcProperty" ? (result = func(...args), result = new Promise( | ||
(resolve, reject) => result.then((v) => { | ||
if (v.hasOwnProperty(Symbol.dispose) && delete v[Symbol.dispose], v.hasOwnProperty(Symbol.asyncDispose) && delete v[Symbol.asyncDispose], v.constructor.name === "RpcStub") | ||
return resolve(new Proxy({ v }, { | ||
get(target2, p) { | ||
return target2.v[p]; | ||
} | ||
})); | ||
resolve(v); | ||
}).catch(reject) | ||
)) : result = func.apply(target, args), isR2ObjectWriteHttpMetadata(targetName, keyHeader) && (result = args[0]); | ||
} catch (e) { | ||
@@ -740,0 +750,0 @@ status = 500, result = e; |
{ | ||
"name": "miniflare", | ||
"version": "3.20240405.1", | ||
"version": "3.20240405.2", | ||
"description": "Fun, full-featured, fully-local simulator for Cloudflare Workers", | ||
@@ -78,3 +78,3 @@ "keywords": [ | ||
"source-map": "^0.6.0", | ||
"typescript": "~5.0.4", | ||
"typescript": "^5.4.5", | ||
"which": "^2.0.2", | ||
@@ -81,0 +81,0 @@ "@cloudflare/kv-asset-handler": "0.3.1" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1582125
30762