chore: Fix browser example

This commit is contained in:
LuanRT
2024-05-23 21:00:47 -03:00
parent c82bb70180
commit aa3f34c428
4 changed files with 1611 additions and 4391 deletions

View File

@@ -6,7 +6,9 @@ import {
Response,
Headers,
FormData,
File
File,
setGlobalDispatcher,
Agent
} from 'undici';
import type { ICache } from '../types/Cache.js';
import { Platform } from '../utils/Utils.js';
@@ -27,6 +29,12 @@ const __dirname__ = is_cjs ? __dirname : path.dirname(fileURLToPath(meta_url));
const { homepage, version, bugs } = $INLINE_JSON('../../package.json');
const repo_url = homepage?.split('#')[0];
setGlobalDispatcher(new Agent({
connect: {
timeout: 60_000
}
}));
class Cache implements ICache {
#persistent_directory: string;
#persistent: boolean;