Files
zkldi_Tachi/server/src/fetch.ts
T
2021-04-16 23:35:58 +01:00

11 lines
280 B
TypeScript

import nodeFetch from "node-fetch";
const fetch =
process.env.NODE_ENV === "test"
? () => {
throw new Error("Cannot use real fetch inside testing env!");
}
: nodeFetch;
export default (fetch as unknown) as typeof nodeFetch;