mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-19 05:46:04 +00:00
adapter(cloudflare): removed durable mode, added withPlatformProxy (#233)
* removed `durable` mode as it requires an import from "cloudflare:" that often fails in non-cf environments * remove worker configuration types * add `withPlatformProxy` * withPlatformProxy: make configuration optional
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { inspect } from "node:util";
|
||||
|
||||
export type BindingTypeMap = {
|
||||
D1Database: D1Database;
|
||||
KVNamespace: KVNamespace;
|
||||
@@ -13,8 +15,9 @@ export function getBindings<T extends GetBindingType>(env: any, type: T): Bindin
|
||||
for (const key in env) {
|
||||
try {
|
||||
if (
|
||||
env[key] &&
|
||||
((env[key] as any).constructor.name === type || String(env[key]) === `[object ${type}]`)
|
||||
(env[key] as any).constructor.name === type ||
|
||||
String(env[key]) === `[object ${type}]` ||
|
||||
inspect(env[key]).includes(type)
|
||||
) {
|
||||
bindings.push({
|
||||
key,
|
||||
|
||||
Reference in New Issue
Block a user