mirror of
https://github.com/zkldi/Tachi.git
synced 2026-10-12 09:18:25 +03:00
rename src/common to src/utils
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import nodeFetch from "node-fetch";
|
||||
|
||||
const fetch =
|
||||
process.env.NODE_ENV === "test"
|
||||
? () => {
|
||||
throw new Error("Cannot use real fetch inside testing env!");
|
||||
}
|
||||
: nodeFetch;
|
||||
|
||||
export type NodeFetch = (url: RequestInfo, init?: RequestInit | undefined) => Promise<Response>;
|
||||
|
||||
export default (fetch as unknown) as NodeFetch;
|
||||
Reference in New Issue
Block a user