Fixed typo in Worker
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
This commit is contained in:
parent
f0090c137c
commit
bea0774b4c
|
@ -44,6 +44,7 @@ const router = Router()
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
switch (obj.constructor.name) {
|
switch (obj.constructor.name) {
|
||||||
|
case 'KvNamespace':
|
||||||
case 'KVNamespace':
|
case 'KVNamespace':
|
||||||
kv.push(all[i])
|
kv.push(all[i])
|
||||||
break
|
break
|
||||||
|
@ -170,7 +171,7 @@ async function setupKVRequest(
|
||||||
return { errorRes: new Response('Bad request', { status: 400 }) }
|
return { errorRes: new Response('Bad request', { status: 400 }) }
|
||||||
}
|
}
|
||||||
const namespace = env[req.params.namespace] as KVNamespace<string>
|
const namespace = env[req.params.namespace] as KVNamespace<string>
|
||||||
if (typeof namespace != 'object' || namespace?.constructor?.name != 'KVNamespace') {
|
if (typeof namespace != 'object' || !['KVNamespace', 'KvNamespace'].includes(namespace?.constructor?.name)) {
|
||||||
return {
|
return {
|
||||||
errorRes: new Response(
|
errorRes: new Response(
|
||||||
`Worker is not bound to KV '${req.params.kv}'`,
|
`Worker is not bound to KV '${req.params.kv}'`,
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue