mirror of
https://github.com/roleypoly/roleypoly.git
synced 2025-04-24 19:39:11 +00:00
inject fetch into KV emu
This commit is contained in:
parent
22cbde52dd
commit
12d8e99513
2 changed files with 3 additions and 0 deletions
|
@ -90,6 +90,7 @@
|
|||
"jest-styled-components": "^7.0.3",
|
||||
"level": "^6.0.1",
|
||||
"minimist": "^1.2.5",
|
||||
"node-fetch": "^2.6.1",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.2.1",
|
||||
"prettier-plugin-organize-imports": "^1.1.1",
|
||||
|
|
|
@ -9,6 +9,7 @@ const { Crypto } = require('@peculiar/webcrypto');
|
|||
const roleypolyConfig = require('../backend-worker/roleypoly.config');
|
||||
const { KVShim } = require('./kv');
|
||||
const crypto = new Crypto();
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
const getKVs = (namespaces = []) =>
|
||||
namespaces.reduce((acc, ns) => ({ ...acc, [ns]: new KVShim(ns) }), {});
|
||||
|
@ -43,6 +44,7 @@ const context = () =>
|
|||
setInterval: setInterval,
|
||||
clearInterval: clearInterval,
|
||||
clearTimeout: clearTimeout,
|
||||
fetch: fetch,
|
||||
...workerShims,
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue