Spaces:
Sleeping
Sleeping
Download store/v2/debug.ts from asemxin2000/wechat-article: direct link, hf CLI and curl.
- Browser
- Download file 664 Bytes
-
https://huggingface.co/spaces/asemxin2000/wechat-article/resolve/main/store/v2/debug.ts
- Command line
-
hf download hf://spaces/asemxin2000/wechat-article/store/v2/debug.ts
-
curl -L -o debug.ts https://huggingface.co/spaces/asemxin2000/wechat-article/resolve/main/store/v2/debug.ts
664 Bytes
| import { db } from './db'; | |
| export interface DebugAsset { | |
| type: string; | |
| url: string; | |
| file: Blob; | |
| title: string; | |
| fakeid: string; | |
| } | |
| /** | |
| * 更新 html 缓存 | |
| * @param html 缓存 | |
| */ | |
| export async function updateDebugCache(html: DebugAsset): Promise<boolean> { | |
| return db.transaction('rw', 'debug', async () => { | |
| await db.debug.put(html); | |
| return true; | |
| }); | |
| } | |
| /** | |
| * 获取 asset 缓存 | |
| * @param url | |
| */ | |
| export async function getDebugCache(url: string): Promise<DebugAsset | undefined> { | |
| return db.debug.get(url); | |
| } | |
| export async function getDebugInfo(): Promise<DebugAsset[]> { | |
| return db.debug.toArray(); | |
| } | |